QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#166750#6740. FunctionPhantomThreshold#TL 905ms4040kbC++20440b2023-09-06 17:39:232023-09-06 17:39:23

Judging History

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

  • [2023-09-06 17:39:23]
  • 评测
  • 测评结果:TL
  • 用时:905ms
  • 内存:4040kb
  • [2023-09-06 17:39:23]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll mod=998244353;
const int maxn=20210926;
map<ll,ll> dict;

ll f(ll n){
	if (n<=0) return 0;
	if (n==1) return 1;
	if (dict.count(n)) return dict[n];
	ll ans=1;
	for (int i=2;i<=n && i<=maxn;i++) ans=(ans+f(n/i))%mod;
	return dict[n]=ans;
}
ll n;

int main(){
	ios_base::sync_with_stdio(false);
	cin >> n;
	cout << f(n) << "\n";
	return 0;
}

详细

Test #1:

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

input:

1

output:

1

result:

ok 1 number(s): "1"

Test #2:

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

input:

2

output:

2

result:

ok 1 number(s): "2"

Test #3:

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

input:

100

output:

949

result:

ok 1 number(s): "949"

Test #4:

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

input:

10

output:

19

result:

ok 1 number(s): "19"

Test #5:

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

input:

1000

output:

48614

result:

ok 1 number(s): "48614"

Test #6:

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

input:

10000

output:

2602393

result:

ok 1 number(s): "2602393"

Test #7:

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

input:

100000

output:

139804054

result:

ok 1 number(s): "139804054"

Test #8:

score: 0
Accepted
time: 78ms
memory: 3728kb

input:

1000000

output:

521718285

result:

ok 1 number(s): "521718285"

Test #9:

score: 0
Accepted
time: 905ms
memory: 4040kb

input:

10000000

output:

503104917

result:

ok 1 number(s): "503104917"

Test #10:

score: -100
Time Limit Exceeded

input:

100000000

output:


result: