QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#219866#6740. FunctionzhoujiuWA 91ms4408kbC++20423b2023-10-19 19:18:582023-10-19 19:18:59

Judging History

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

  • [2023-10-19 19:18:59]
  • 评测
  • 测评结果:WA
  • 用时:91ms
  • 内存:4408kb
  • [2023-10-19 19:18:58]
  • 提交

answer

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

const int mod=998244353;
const int M=20210926;

int n;
unordered_map<int,int> mp;

int dfs(int n)
{
	if(n==1) return 1;
	if(mp[n]) return mp[n];

	int res=1;
	for(int l=2;l<=M&&l<=n;l++)
	{
		int d=n/l,r=n/d;

		res=(res+dfs(d)*(r-l+1))%mod;
		l=r;
	}

	return mp[n]=res;
}

signed main()
{
	cin>>n;

	cout<<dfs(n)<<'\n';
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1

output:

1

result:

ok 1 number(s): "1"

Test #2:

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

input:

2

output:

2

result:

ok 1 number(s): "2"

Test #3:

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

input:

100

output:

949

result:

ok 1 number(s): "949"

Test #4:

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

input:

10

output:

19

result:

ok 1 number(s): "19"

Test #5:

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

input:

1000

output:

48614

result:

ok 1 number(s): "48614"

Test #6:

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

input:

10000

output:

2602393

result:

ok 1 number(s): "2602393"

Test #7:

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

input:

100000

output:

139804054

result:

ok 1 number(s): "139804054"

Test #8:

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

input:

1000000

output:

521718285

result:

ok 1 number(s): "521718285"

Test #9:

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

input:

10000000

output:

503104917

result:

ok 1 number(s): "503104917"

Test #10:

score: -100
Wrong Answer
time: 91ms
memory: 4408kb

input:

100000000

output:

255039677

result:

wrong answer 1st numbers differ - expected: '198815604', found: '255039677'