QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#287346#5817. 小学生数学题UZING40 997ms3672kbC++14401b2023-12-20 13:07:572023-12-20 13:07:58

Judging History

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

  • [2023-12-20 13:07:58]
  • 评测
  • 测评结果:40
  • 用时:997ms
  • 内存:3672kb
  • [2023-12-20 13:07:57]
  • 提交

answer

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

詳細信息

Test #1:

score: 0
Time Limit Exceeded

input:

9450395 1

output:

688545438

result:


Test #2:

score: 10
Accepted
time: 997ms
memory: 3544kb

input:

8978812 1

output:

334565356

result:

ok single line: '334565356'

Test #3:

score: 10
Accepted
time: 990ms
memory: 3608kb

input:

8944235 1

output:

982802915

result:

ok single line: '982802915'

Test #4:

score: 10
Accepted
time: 825ms
memory: 3668kb

input:

7081118 3

output:

599009773

result:

ok single line: '599009773'

Test #5:

score: 10
Accepted
time: 920ms
memory: 3672kb

input:

7904241 3

output:

871243720

result:

ok single line: '871243720'

Test #6:

score: 0
Time Limit Exceeded

input:

9921275 3

output:


result:


Test #7:

score: 0
Time Limit Exceeded

input:

17575748 14135489

output:


result:


Test #8:

score: 0
Time Limit Exceeded

input:

19858362 14822524

output:


result:


Test #9:

score: 0
Time Limit Exceeded

input:

18848696 15530895

output:


result:


Test #10:

score: 0
Time Limit Exceeded

input:

17787945 13890407

output:


result: