QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#209988#6740. FunctionhuamuyichunWA 0ms3672kbC++14982b2023-10-10 21:12:292023-10-10 21:12:29

Judging History

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

  • [2023-10-10 21:12:29]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3672kb
  • [2023-10-10 21:12:29]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define _for(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
#define debug(a) cout<<#a<<a<<endl;
#define int long long
#define io_speed_up ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
typedef long long ll;
typedef unsigned long long u64;
typedef pair<int,int> pii;
typedef vector<int> vi;
const int mod=998244353;
map<int,int> mp;
int w[1000005];
int n;
int min(int x,int y) {return (x<y) ? x:y;}
int f(int x){
    if(x<=3) return x;
    if(x<=1000000&&w[x]) return w[x];
    if(mp.find(x)!=mp.end()) return mp[x];
    int rs=1;
    for(int l=2,r;l<=min(x,20210926);l=r+1){
        r=min((n/(n/l)),20210926);
        rs=(rs+(r-l+1)*f(x/l))%mod;
    }
    cout<<" "<<rs<<endl;
    return (x<=1000000)?(w[x]=rs):(mp[x]=rs);
}
signed main(){
    io_speed_up;
    cin>>n;
    int ans=f(n);
    cout<<ans<<endl;
    return 0;
}

详细

Test #1:

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

input:

1

output:

1

result:

ok 1 number(s): "1"

Test #2:

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

input:

2

output:

2

result:

ok 1 number(s): "2"

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3664kb

input:

100

output:

 9
 5
 28
 14
 6
 90
 43
 19
 10
 291
 20
 139
 61
 32
 16
 949
949

result:

wrong answer 1st numbers differ - expected: '949', found: '9'