QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#166750 | #6740. Function | PhantomThreshold# | TL | 905ms | 4040kb | C++20 | 440b | 2023-09-06 17:39:23 | 2023-09-06 17:39:23 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=998244353;
const int maxn=20210926;
map<ll,ll> dict;
ll f(ll n){
if (n<=0) return 0;
if (n==1) return 1;
if (dict.count(n)) return dict[n];
ll ans=1;
for (int i=2;i<=n && i<=maxn;i++) ans=(ans+f(n/i))%mod;
return dict[n]=ans;
}
ll n;
int main(){
ios_base::sync_with_stdio(false);
cin >> n;
cout << f(n) << "\n";
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3588kb
input:
1
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
2
output:
2
result:
ok 1 number(s): "2"
Test #3:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
100
output:
949
result:
ok 1 number(s): "949"
Test #4:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
10
output:
19
result:
ok 1 number(s): "19"
Test #5:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
1000
output:
48614
result:
ok 1 number(s): "48614"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
10000
output:
2602393
result:
ok 1 number(s): "2602393"
Test #7:
score: 0
Accepted
time: 8ms
memory: 3632kb
input:
100000
output:
139804054
result:
ok 1 number(s): "139804054"
Test #8:
score: 0
Accepted
time: 78ms
memory: 3728kb
input:
1000000
output:
521718285
result:
ok 1 number(s): "521718285"
Test #9:
score: 0
Accepted
time: 905ms
memory: 4040kb
input:
10000000
output:
503104917
result:
ok 1 number(s): "503104917"
Test #10:
score: -100
Time Limit Exceeded
input:
100000000