QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#637265 | #6740. Function | UESTC_DECAYALI# | WA | 101ms | 4460kb | C++20 | 1.1kb | 2024-10-13 11:52:24 | 2024-10-13 11:52:24 |
Judging History
answer
#include<cstdio>
#include<iostream>
#include<cassert>
#include<unordered_map>
#define RI register int
#define CI const int&
using namespace std;
const int mod=998244353;
int n; unordered_map <int,int> g;
inline int G(CI n)
{
if (g.count(n)) return g[n]; int ret=1;
for (RI l=2,r;l<=n&&l<=20210926;l=r+1)
r=n/(n/l),(ret+=1LL*(r-l+1)*G(n/l)%mod)%=mod;
return g[n]=ret;
}
int main()
{
scanf("%d",&n);
/*for (int n=1;n<=1000;++n)
{
static int f[1005],g[1005];
for (RI x=1000;x>=1;--x)
{
f[x]=1;
for (RI k=2;k<=20210926;++k)
{
long long y=x*k;
if (y>n) break;
(f[x]+=f[y])%=mod;
}
}
for (RI x=1;x<=1000;++x)
{
g[x]=1;
for (RI k=2;k<=20210926;++k)
{
int y=x/k;
if (y==0) break;
(g[x]+=g[y])%=mod;
}
}
assert(f[1]==g[n]);
//printf("%d %d\n",f[1],g[n]);
}*/
return printf("%d",G(n)),0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3812kb
input:
1
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
2
output:
2
result:
ok 1 number(s): "2"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
100
output:
949
result:
ok 1 number(s): "949"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
10
output:
19
result:
ok 1 number(s): "19"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
1000
output:
48614
result:
ok 1 number(s): "48614"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
10000
output:
2602393
result:
ok 1 number(s): "2602393"
Test #7:
score: 0
Accepted
time: 1ms
memory: 3824kb
input:
100000
output:
139804054
result:
ok 1 number(s): "139804054"
Test #8:
score: 0
Accepted
time: 3ms
memory: 3796kb
input:
1000000
output:
521718285
result:
ok 1 number(s): "521718285"
Test #9:
score: 0
Accepted
time: 14ms
memory: 4364kb
input:
10000000
output:
503104917
result:
ok 1 number(s): "503104917"
Test #10:
score: -100
Wrong Answer
time: 101ms
memory: 4460kb
input:
100000000
output:
255039677
result:
wrong answer 1st numbers differ - expected: '198815604', found: '255039677'