QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#287964#5817. 小学生数学题Haoyue_0643220 942ms3696kbC++14461b2023-12-21 13:20:462023-12-21 13:20:48

Judging History

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

  • [2023-12-21 13:20:48]
  • 评测
  • 测评结果:20
  • 用时:942ms
  • 内存:3696kb
  • [2023-12-21 13:20:46]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define maxn 1000005
#define inf 1e18
#define mod 998244353
using namespace std;
ll n,m,ans1=1,ans2,ans;
ll ksm(ll x,ll y)
{
	ll ans=1;
	while(y)
	{
		if(y%2==1)ans=(ans*x)%mod;
		x=(x*x)%mod;
		y/=2;
	}
	return ans;
}
int main()
{
	cin>>n>>m;
	for(int i=1;i<=n;i++)
	{
		ans1=(ans1*i)%mod;
		ans2=ksm(i,m);
		ans=(ans+(ans1*ksm(ans2,mod-2))%mod)%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:

688545438

result:


Test #2:

score: 0
Time Limit Exceeded

input:

8978812 1

output:

334565356

result:


Test #3:

score: 0
Time Limit Exceeded

input:

8944235 1

output:

982802915

result:


Test #4:

score: 10
Accepted
time: 843ms
memory: 3596kb

input:

7081118 3

output:

599009773

result:

ok single line: '599009773'

Test #5:

score: 10
Accepted
time: 942ms
memory: 3696kb

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: