QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#202583 | #872. Joyful Numbers | isaunoya | WA | 1ms | 3496kb | C++23 | 511b | 2023-10-06 12:17:46 | 2023-10-06 12:17:47 |
Judging History
answer
#include<iostream>
#include<cstdio>
using namespace std;
int k;
int count(__int128 n)
{
int cnt=0;
for(int i=2;(__int128)i*i<=n;i++)
if(n%i==0)
{
cnt++;
while(n%i==0) n/=i;
}
cnt++;
return cnt;
}
void solve()
{
cin>>k;
__int128 n=(__int128)(k*10ll+5)*(k*10ll+5)/100;
cout<<count(n)<<"\n";
return;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr),cout.tie(nullptr);
int T;
cin>>T;
while(T--)
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3496kb
input:
2 1 4
output:
1 2
result:
ok 2 number(s): "1 2"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3428kb
input:
1 1000000000
output:
7
result:
ok 1 number(s): "7"
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3424kb
input:
10 1 2 3 4 5 6 7 8 9 10
output:
1 2 2 2 3 3 2 3 3 3
result:
wrong answer 8th numbers differ - expected: '2', found: '3'