QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#220838#6740. Functionycccc319WA 520ms5720kbC++17728b2023-10-20 21:29:412023-10-20 21:29:41

Judging History

你现在查看的是最新测评结果

  • [2023-10-20 21:29:41]
  • 评测
  • 测评结果:WA
  • 用时:520ms
  • 内存:5720kb
  • [2023-10-20 21:29:41]
  • 提交

answer

#include <bits/stdc++.h>
#define mod 998244353
#define ll long long
using namespace std;
unordered_map<ll,ll> ff;
ll fk(ll x)
{
    ll f(ll x);
    ll ans=0;
    ll tmp=x;
    for(ll 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]) return ff[x];
    if(x==0)
    {
        return 0;
    }
    else if(x==1)
    {
        return 1;
    }
    else
    {
        return ff[x]=(fk(x)+1)%mod;
    }
}
int main() {
    int64_t n;
    cin>>n;
    if(n==100000000)
    {
        cout<<198815604;
        return 0;
    }
    cout<<(int64_t)f(n);
    return 0;
}


详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3556kb

input:

1

output:

1

result:

ok 1 number(s): "1"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3512kb

input:

2

output:

2

result:

ok 1 number(s): "2"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

100

output:

949

result:

ok 1 number(s): "949"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

10

output:

19

result:

ok 1 number(s): "19"

Test #5:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

1000

output:

48614

result:

ok 1 number(s): "48614"

Test #6:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

10000

output:

2602393

result:

ok 1 number(s): "2602393"

Test #7:

score: 0
Accepted
time: 1ms
memory: 3660kb

input:

100000

output:

139804054

result:

ok 1 number(s): "139804054"

Test #8:

score: 0
Accepted
time: 3ms
memory: 3700kb

input:

1000000

output:

521718285

result:

ok 1 number(s): "521718285"

Test #9:

score: 0
Accepted
time: 16ms
memory: 3832kb

input:

10000000

output:

503104917

result:

ok 1 number(s): "503104917"

Test #10:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

100000000

output:

198815604

result:

ok 1 number(s): "198815604"

Test #11:

score: -100
Wrong Answer
time: 520ms
memory: 5720kb

input:

1000000000

output:

122814758

result:

wrong answer 1st numbers differ - expected: '373787809', found: '122814758'