QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#220828 | #6740. Function | ycccc319 | WA | 0ms | 3428kb | C++17 | 654b | 2023-10-20 21:12:38 | 2023-10-20 21:12:38 |
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(ff[x] or x<20230000) return ff[x];
if(x==0)
{
return 0;
}
else if(x==1)
{
return 1;
}
else
{
return ff[x]=(fk(x)+1)%mod;
}
}
int main() {
ll n;
cin>>n;
cout<<f(n);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3428kb
input:
1
output:
0
result:
wrong answer 1st numbers differ - expected: '1', found: '0'