QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#178101 | #7046. Function! | linnins | TL | 605ms | 1624kb | C++14 | 534b | 2023-09-13 17:58:35 | 2023-09-13 17:58:35 |
Judging History
answer
#include <cstdio>
#include <cmath>
const int mp = 998244353;
int main(){
long long n;
scanf("%lld", &n);
int sqt = sqrt(n);
long long ans = 0;
for(long long a = 2; a <= n; ++a){
long long t = a;
long long temp = 0;
int temp2 = 1;
while(t * a <= n){
temp = (temp + (((t * a % mp - t + mp) % mp) * temp2) % mp) % mp;
t = t * a;
++temp2;
}
temp = (temp + ((n - t + mp + 1) % mp * temp2) % mp) % mp;
ans = (ans + a * temp % mp) % mp;
}
//ans = ans +
printf("%lld", ans);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 1592kb
input:
2
output:
2
result:
ok 1 number(s): "2"
Test #2:
score: 0
Accepted
time: 0ms
memory: 1564kb
input:
10
output:
236
result:
ok 1 number(s): "236"
Test #3:
score: 0
Accepted
time: 0ms
memory: 1460kb
input:
20
output:
1646
result:
ok 1 number(s): "1646"
Test #4:
score: 0
Accepted
time: 0ms
memory: 1600kb
input:
27
output:
3862
result:
ok 1 number(s): "3862"
Test #5:
score: 0
Accepted
time: 0ms
memory: 1620kb
input:
37
output:
9571
result:
ok 1 number(s): "9571"
Test #6:
score: 0
Accepted
time: 0ms
memory: 1584kb
input:
100
output:
175028
result:
ok 1 number(s): "175028"
Test #7:
score: 0
Accepted
time: 0ms
memory: 1592kb
input:
123
output:
322744
result:
ok 1 number(s): "322744"
Test #8:
score: 0
Accepted
time: 0ms
memory: 1596kb
input:
2548
output:
765669726
result:
ok 1 number(s): "765669726"
Test #9:
score: 0
Accepted
time: 0ms
memory: 1460kb
input:
12448
output:
159637196
result:
ok 1 number(s): "159637196"
Test #10:
score: 0
Accepted
time: 0ms
memory: 1588kb
input:
65535
output:
120089112
result:
ok 1 number(s): "120089112"
Test #11:
score: 0
Accepted
time: 1ms
memory: 1620kb
input:
102458
output:
475774506
result:
ok 1 number(s): "475774506"
Test #12:
score: 0
Accepted
time: 1ms
memory: 1564kb
input:
222333
output:
64337543
result:
ok 1 number(s): "64337543"
Test #13:
score: 0
Accepted
time: 3ms
memory: 1604kb
input:
485174
output:
312492357
result:
ok 1 number(s): "312492357"
Test #14:
score: 0
Accepted
time: 4ms
memory: 1464kb
input:
685479
output:
35530508
result:
ok 1 number(s): "35530508"
Test #15:
score: 0
Accepted
time: 6ms
memory: 1600kb
input:
1025481
output:
921523794
result:
ok 1 number(s): "921523794"
Test #16:
score: 0
Accepted
time: 60ms
memory: 1464kb
input:
9999999
output:
732610409
result:
ok 1 number(s): "732610409"
Test #17:
score: 0
Accepted
time: 45ms
memory: 1564kb
input:
7458658
output:
825346623
result:
ok 1 number(s): "825346623"
Test #18:
score: 0
Accepted
time: 32ms
memory: 1624kb
input:
5268475
output:
30938162
result:
ok 1 number(s): "30938162"
Test #19:
score: 0
Accepted
time: 13ms
memory: 1624kb
input:
2658478
output:
780038100
result:
ok 1 number(s): "780038100"
Test #20:
score: 0
Accepted
time: 60ms
memory: 1616kb
input:
10000000
output:
679483439
result:
ok 1 number(s): "679483439"
Test #21:
score: 0
Accepted
time: 605ms
memory: 1620kb
input:
100000000
output:
498142384
result:
ok 1 number(s): "498142384"
Test #22:
score: -100
Time Limit Exceeded
input:
1000000000