QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#129421 | #6740. Function | KaphI | TL | 364ms | 4588kb | C++14 | 380b | 2023-07-22 19:21:57 | 2023-07-22 19:22:00 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int M=998244353;
int n;
map<int,int>mp;
int f(int x){
if(mp.find(x)!=mp.end())return mp[x];
if(x==1)return 1;
int rs=1;
for(int l=2,r;l<=min(x,20210926);l=r+1){
r=min(x/(x/l),20210926);
rs=(rs+1ll*(r-l+1)*f(x/l))%M;
}
return mp[x]=rs;
}
int main(){
scanf("%d",&n);
printf("%d\n",f(n));
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3660kb
input:
1
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3704kb
input:
2
output:
2
result:
ok 1 number(s): "2"
Test #3:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
100
output:
949
result:
ok 1 number(s): "949"
Test #4:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
10
output:
19
result:
ok 1 number(s): "19"
Test #5:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
1000
output:
48614
result:
ok 1 number(s): "48614"
Test #6:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
10000
output:
2602393
result:
ok 1 number(s): "2602393"
Test #7:
score: 0
Accepted
time: 2ms
memory: 3672kb
input:
100000
output:
139804054
result:
ok 1 number(s): "139804054"
Test #8:
score: 0
Accepted
time: 8ms
memory: 3756kb
input:
1000000
output:
521718285
result:
ok 1 number(s): "521718285"
Test #9:
score: 0
Accepted
time: 53ms
memory: 3964kb
input:
10000000
output:
503104917
result:
ok 1 number(s): "503104917"
Test #10:
score: 0
Accepted
time: 364ms
memory: 4588kb
input:
100000000
output:
198815604
result:
ok 1 number(s): "198815604"
Test #11:
score: -100
Time Limit Exceeded
input:
1000000000