QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#289039 | #5817. 小学生数学题 | allen2010y | 0 | 0ms | 0kb | C++14 | 431b | 2023-12-23 14:58:09 | 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;
}
詳細信息
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