QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#220831 | #6740. Function | ycccc319 | WA | 57ms | 7168kb | C++17 | 706b | 2023-10-20 21:14:25 | 2023-10-20 21:14:25 |
Judging History
answer
#include <bits/stdc++.h>
#define mod 998244353
#define ll long long
using namespace std;
ll ff[20230000];
ll fk(ll x)
{
ll f(ll x);
ll ans=0;
ll tmp=min(x,20210926ll);
for(int l=1,r=0;l<=tmp;l=r+1)
{
r = tmp / (tmp / l);
if(l==1) continue;
ans=(ans+(r-l+1)*f(x/l)%mod)%mod;
}
return ans;
}
ll f(ll x)
{
if(x<20230000 and ff[x]) return ff[x];
if(x==0)
{
return 0;
}
else if(x==1)
{
return 1;
}
else
{
if(x>=20230000)return (fk(x)+1)%mod;
else return ff[x]=(fk(x)+1)%mod;
}
}
int main() {
ll n;
cin>>n;
cout<<f(n);
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3584kb
input:
1
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
2
output:
2
result:
ok 1 number(s): "2"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
100
output:
949
result:
ok 1 number(s): "949"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
10
output:
19
result:
ok 1 number(s): "19"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
1000
output:
48614
result:
ok 1 number(s): "48614"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3684kb
input:
10000
output:
2602393
result:
ok 1 number(s): "2602393"
Test #7:
score: 0
Accepted
time: 1ms
memory: 3836kb
input:
100000
output:
139804054
result:
ok 1 number(s): "139804054"
Test #8:
score: 0
Accepted
time: 2ms
memory: 3928kb
input:
1000000
output:
521718285
result:
ok 1 number(s): "521718285"
Test #9:
score: 0
Accepted
time: 12ms
memory: 4644kb
input:
10000000
output:
503104917
result:
ok 1 number(s): "503104917"
Test #10:
score: -100
Wrong Answer
time: 57ms
memory: 7168kb
input:
100000000
output:
687292339
result:
wrong answer 1st numbers differ - expected: '198815604', found: '687292339'