QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#626928#9248. An Easy Math Problemcabbagea#WA 53ms4716kbC++17905b2024-10-10 14:03:282024-10-10 14:03:29

Judging History

This is the latest submission verdict.

  • [2024-10-31 22:36:43]
  • hack成功,自动添加数据
  • (/hack/1098)
  • [2024-10-31 22:13:58]
  • hack成功,自动添加数据
  • (/hack/1096)
  • [2024-10-31 22:00:43]
  • hack成功,自动添加数据
  • (/hack/1095)
  • [2024-10-10 14:03:29]
  • Judged
  • Verdict: WA
  • Time: 53ms
  • Memory: 4716kb
  • [2024-10-10 14:03:28]
  • Submitted

answer

#include <bits/stdc++.h>
#define int long long
#define endl "\n"
#define fp fixed << setprecision(20)
using namespace std;

const int N=1e5+10;
vector<int> v; int st[N];
void init(){
    for(int i=2;i<1e5+10;i++)
    {
        if(st[i]) continue;
        v.push_back(i);
        for(int k=i+i;k<N;k+=i)
            st[k]=1;
    }
return ;
}

void solve() {
    int n;
    cin>>n;
    vector<int> vv; int Max=0;
    for(int i:v)
    {
        int j=0;
        while(n%i==0)
        {
           n/=i;
           j++;
        }
        Max=max(Max,j);
        if(j) vv.push_back(j);
    }
    int res=1;
    for(int i:vv) res=res*(i+1);
    if((int)vv.size()>1) res+=Max;
    cout<<res<<endl;
}

signed main() {
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int T=1;
    init();
    cin>>T;
    while(T--) {
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 4448kb

input:

10
1
2
3
4
5
6
7
8
9
10

output:

1
2
2
3
2
5
2
4
3
5

result:

ok 10 lines

Test #2:

score: -100
Wrong Answer
time: 53ms
memory: 4716kb

input:

2000
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
646969323...

output:

1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
1025
...

result:

wrong answer 1st lines differ - expected: '29525', found: '1025'