QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#289062#5817. 小学生数学题allen2010y30 78ms3560kbC++14391b2023-12-23 15:04:052023-12-23 15:04:06

Judging History

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

  • [2023-12-23 15:04:06]
  • 评测
  • 测评结果:30
  • 用时:78ms
  • 内存:3560kb
  • [2023-12-23 15:04:05]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int mod=998244353;
int fspow(int a,int n)
{
	int ans=a;
	while(n)
	{
		ans*=ans;
		ans%=mod;
		if(n&1) n--,ans*=a,ans%=mod;
		n>>=1;
	}
	return ans;
}
int main()
{
	long long n,k,ans=0,last=1;
	cin>>n>>k;
	for(int i=1;i<=n-1;i++)
	{
		last*=i;
		last%=mod;
		ans+=last;
		ans%=mod;
	}
	cout<<ans+1;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 10
Accepted
time: 37ms
memory: 3372kb

input:

9450395 1

output:

688545438

result:

ok single line: '688545438'

Test #2:

score: 10
Accepted
time: 31ms
memory: 3360kb

input:

8978812 1

output:

334565356

result:

ok single line: '334565356'

Test #3:

score: 10
Accepted
time: 35ms
memory: 3296kb

input:

8944235 1

output:

982802915

result:

ok single line: '982802915'

Test #4:

score: 0
Wrong Answer
time: 28ms
memory: 3372kb

input:

7081118 3

output:

856241751

result:

wrong answer 1st lines differ - expected: '599009773', found: '856241751'

Test #5:

score: 0
Wrong Answer
time: 31ms
memory: 3420kb

input:

7904241 3

output:

209857166

result:

wrong answer 1st lines differ - expected: '871243720', found: '209857166'

Test #6:

score: 0
Wrong Answer
time: 39ms
memory: 3424kb

input:

9921275 3

output:

307807180

result:

wrong answer 1st lines differ - expected: '549818101', found: '307807180'

Test #7:

score: 0
Wrong Answer
time: 65ms
memory: 3368kb

input:

17575748 14135489

output:

733367864

result:

wrong answer 1st lines differ - expected: '69236780', found: '733367864'

Test #8:

score: 0
Wrong Answer
time: 78ms
memory: 3304kb

input:

19858362 14822524

output:

856686891

result:

wrong answer 1st lines differ - expected: '239890381', found: '856686891'

Test #9:

score: 0
Wrong Answer
time: 73ms
memory: 3384kb

input:

18848696 15530895

output:

266059229

result:

wrong answer 1st lines differ - expected: '88125041', found: '266059229'

Test #10:

score: 0
Wrong Answer
time: 69ms
memory: 3560kb

input:

17787945 13890407

output:

582771673

result:

wrong answer 1st lines differ - expected: '989967864', found: '582771673'