QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#129421#6740. FunctionKaphITL 364ms4588kbC++14380b2023-07-22 19:21:572023-07-22 19:22:00

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-22 19:22:00]
  • 评测
  • 测评结果:TL
  • 用时:364ms
  • 内存:4588kb
  • [2023-07-22 19:21:57]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int M=998244353;
int n;
map<int,int>mp;
int f(int x){
	if(mp.find(x)!=mp.end())return mp[x];
	if(x==1)return 1;
	int rs=1;
	for(int l=2,r;l<=min(x,20210926);l=r+1){
		r=min(x/(x/l),20210926);
		rs=(rs+1ll*(r-l+1)*f(x/l))%M;
	}
	return mp[x]=rs;
}
int main(){
	scanf("%d",&n);
	printf("%d\n",f(n));
	return 0;
}

详细

Test #1:

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

input:

1

output:

1

result:

ok 1 number(s): "1"

Test #2:

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

input:

2

output:

2

result:

ok 1 number(s): "2"

Test #3:

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

input:

100

output:

949

result:

ok 1 number(s): "949"

Test #4:

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

input:

10

output:

19

result:

ok 1 number(s): "19"

Test #5:

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

input:

1000

output:

48614

result:

ok 1 number(s): "48614"

Test #6:

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

input:

10000

output:

2602393

result:

ok 1 number(s): "2602393"

Test #7:

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

input:

100000

output:

139804054

result:

ok 1 number(s): "139804054"

Test #8:

score: 0
Accepted
time: 8ms
memory: 3756kb

input:

1000000

output:

521718285

result:

ok 1 number(s): "521718285"

Test #9:

score: 0
Accepted
time: 53ms
memory: 3964kb

input:

10000000

output:

503104917

result:

ok 1 number(s): "503104917"

Test #10:

score: 0
Accepted
time: 364ms
memory: 4588kb

input:

100000000

output:

198815604

result:

ok 1 number(s): "198815604"

Test #11:

score: -100
Time Limit Exceeded

input:

1000000000

output:


result: