QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#297924 | #5817. 小学生数学题 | _JF_ | 0 | 0ms | 0kb | C++14 | 458b | 2024-01-05 13:33:30 | 2024-01-05 13:33:30 |
answer
#include<bits/stdc++.h>
using namespace std;
const int mod=998244353;
#define int long long
int Quickpow(int a,int b){
int ans=1,now=a;
while(b>0){
if(b&1) ans*=now,ans%=mod;
now*=now,now%=mod;
b>>=1;
}
return ans;
}
signed main(){
int n,k,now=1,ans=0;
scanf("%d%d",&n,&k);
for(int i=1;i<=n;i++){
now*=(i%mod),now%=mod;
int pre=Quickpow(Quickpow(i,k),mod-2);
ans=(ans%mod+pre%mod*now%mod)%mod;
}
cout<<ans<<endl;
}
详细
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