QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#289039#5817. 小学生数学题allen2010y0 0ms0kbC++14431b2023-12-23 14:58:092023-12-23 14:58:09

Judging History

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

  • [2023-12-23 14:58:09]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2023-12-23 14:58:09]
  • 提交

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;i++)
	{
		last*=i;
		last%=mod;
		int fz=fspow(fspow(i,k),mod-2);
		ans+=(last+fz)%mod;
		ans%=mod;
	}
	cout<<ans;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Time Limit Exceeded

input:

9450395 1

output:


result:


Test #2:

score: 0
Time Limit Exceeded

input:

8978812 1

output:


result:


Test #3:

score: 0
Time Limit Exceeded

input:

8944235 1

output:


result:


Test #4:

score: 0
Time Limit Exceeded

input:

7081118 3

output:


result:


Test #5:

score: 0
Time Limit Exceeded

input:

7904241 3

output:


result:


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: