QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#289060 | #5817. 小学生数学题 | allen2010y | 0 | 77ms | 3708kb | C++14 | 389b | 2023-12-23 15:03:38 | 2023-12-23 15:03:39 |
Judging History
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-1;i++)
{
last*=i;
last%=mod;
ans+=last;
ans%=mod;
}
cout<<ans;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 37ms
memory: 3600kb
input:
9450395 1
output:
688545437
result:
wrong answer 1st lines differ - expected: '688545438', found: '688545437'
Test #2:
score: 0
Wrong Answer
time: 31ms
memory: 3708kb
input:
8978812 1
output:
334565355
result:
wrong answer 1st lines differ - expected: '334565356', found: '334565355'
Test #3:
score: 0
Wrong Answer
time: 35ms
memory: 3652kb
input:
8944235 1
output:
982802914
result:
wrong answer 1st lines differ - expected: '982802915', found: '982802914'
Test #4:
score: 0
Wrong Answer
time: 28ms
memory: 3644kb
input:
7081118 3
output:
856241750
result:
wrong answer 1st lines differ - expected: '599009773', found: '856241750'
Test #5:
score: 0
Wrong Answer
time: 31ms
memory: 3648kb
input:
7904241 3
output:
209857165
result:
wrong answer 1st lines differ - expected: '871243720', found: '209857165'
Test #6:
score: 0
Wrong Answer
time: 39ms
memory: 3592kb
input:
9921275 3
output:
307807179
result:
wrong answer 1st lines differ - expected: '549818101', found: '307807179'
Test #7:
score: 0
Wrong Answer
time: 68ms
memory: 3596kb
input:
17575748 14135489
output:
733367863
result:
wrong answer 1st lines differ - expected: '69236780', found: '733367863'
Test #8:
score: 0
Wrong Answer
time: 77ms
memory: 3640kb
input:
19858362 14822524
output:
856686890
result:
wrong answer 1st lines differ - expected: '239890381', found: '856686890'
Test #9:
score: 0
Wrong Answer
time: 73ms
memory: 3636kb
input:
18848696 15530895
output:
266059228
result:
wrong answer 1st lines differ - expected: '88125041', found: '266059228'
Test #10:
score: 0
Wrong Answer
time: 65ms
memory: 3600kb
input:
17787945 13890407
output:
582771672
result:
wrong answer 1st lines differ - expected: '989967864', found: '582771672'