ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1049. Brave Balloonists

WA #1
Posted by jiyujie 25 Apr 2012 13:57
i really don't understand why i got WA #1...i try a lot of tests and i always have the right answer, could anyone give me test 1, please, thx~
Re: WA #1
Posted by jiyujie 25 Apr 2012 14:20

Edited by author 26.04.2012 11:47

Edited by author 26.04.2012 11:48
Re: WA #6
Posted by Rofiqul 26 Jul 2019 21:38
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long a[10],l,s,z=1,q,f;
    vector<long long>v;
    vector<long long>p;
    bool prime[10000];
    memset(prime,true,sizeof(prime));
    for(int i=2;i<=10000;i++){
        if(prime[i]){
            for(int j=i*2;j<=10000;j=j+i){
                prime[j]=false;
            }
        }
    }
    for(int i=2;i<=10000;i++){
        if(prime[i]){
            v.push_back(i);
        }
    }
    q=v.size();
    f=v[q-1];
    for(int i=2;i<=f;i++){
        p.push_back(0);
    }
    for(int j=0;j<10;j++){
        cin>>a[j];
    }
    for(int i=0;i<10;i++){
        l=0,s=0;
        while(a[i]>=v[l]){
            if(a[i]%v[l]==0){
                //cout<<a[i]<<" "<<v[l]<<endl;
                p[v[l]]++;
                a[i]=a[i]/v[l];
            }
            else{
                l++;
            }
        }
    }
    for(int i=0;i<=p.size();i++){
        z=(z*(p[i]+1))%10000;
    }
    z=z%10;
    cout<<z;
    return 0;
}