QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#300786#5817. 小学生数学题ebofan#20 949ms3648kbC++14423b2024-01-08 20:04:222024-07-04 03:17:03

Judging History

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

  • [2024-07-04 03:17:03]
  • 评测
  • 测评结果:20
  • 用时:949ms
  • 内存:3648kb
  • [2024-01-08 20:04:22]
  • 提交

answer

#include<iostream>
#define ll long long
using namespace std;
constexpr ll p = 998244353;
int k;
ll n,ans;
ll jc = 1,fm;
ll mypow(ll x,int tms){
	ll ans = 1;
	while(tms){
		if(tms&1) ans = ans*x%p;
		x=x*x%p;
		tms>>=1;
	}
	return ans;
}
int main(){
	cin>>n>>k;
	for(int i=1;i<=n;i++){
		jc = jc*i%p;
		fm = mypow(mypow(i,k),p-2);
		ans += jc * fm % p;
		ans %= p;
	}
	cout<<ans<<endl;
	return 0;
}

詳細信息

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: 850ms
memory: 3648kb

input:

7081118 3

output:

599009773

result:

ok single line: '599009773'

Test #5:

score: 10
Accepted
time: 949ms
memory: 3632kb

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: