QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#202590 | #872. Joyful Numbers | isaunoya | TL | 60ms | 3608kb | C++23 | 523b | 2023-10-06 12:19:39 | 2023-10-06 12:19:41 |
Judging History
answer
#include<iostream>
#include<cstdio>
using namespace std;
int k;
int count(long long n)
{
int cnt=0;
for(int i=2;(long long)i*i<=n;i++)
if(n%i==0)
{
cnt++;
while(n%i==0) n/=i;
}
if(n!=1) cnt++;
return cnt;
}
void solve()
{
cin>>k;
long long 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: 3432kb
input:
2 1 4
output:
1 2
result:
ok 2 number(s): "1 2"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
1 1000000000
output:
7
result:
ok 1 number(s): "7"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3376kb
input:
10 1 2 3 4 5 6 7 8 9 10
output:
1 2 2 2 3 3 2 2 3 3
result:
ok 10 numbers
Test #4:
score: 0
Accepted
time: 60ms
memory: 3432kb
input:
10 999999991 999999992 999999993 999999994 999999995 999999996 999999997 999999998 999999999 1000000000
output:
5 6 6 7 7 6 6 6 5 7
result:
ok 10 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
10 32 9 62 14 76 31 77 62 9 24
output:
3 3 4 4 4 2 5 4 3 3
result:
ok 10 numbers
Test #6:
score: 0
Accepted
time: 0ms
memory: 3348kb
input:
100 232 917 583 995 377 838 788 210 204 151 21 803 761 119 262 391 580 982 806 913 840 27 129 234 601 704 317 581 49 676 925 932 244 768 257 785 883 11 948 110 389 254 949 742 10 857 422 865 830 92 112 540 244 863 173 471 144 418 341 845 908 941 402 535 476 194 515 594 882 254 453 884 666 724 237 21...
output:
3 5 4 5 5 3 4 5 5 3 4 5 4 5 3 4 5 3 5 4 5 3 5 5 4 5 4 5 3 3 4 4 4 3 4 5 4 3 5 5 5 5 5 4 3 5 4 4 5 4 3 4 4 3 4 4 4 4 5 5 4 4 5 4 5 5 5 6 4 5 4 6 5 4 5 5 4 5 5 3 5 4 5 5 4 4 4 4 3 4 4 4 4 6 4 4 3 5 5 5
result:
ok 100 numbers
Test #7:
score: -100
Time Limit Exceeded
input:
100 971987538 914093604 964244583 924850644 923043291 913356611 964739642 910777513 941966447 974812762 960504375 978958306 958875520 929935610 925926264 933307797 933702996 907774450 904281295 992679895 999563179 945107265 970736983 919138538 984292255 921891421 977320327 935222721 937762694 940914...