QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#404885 | #6736. Alice and Bob | qzuser# | WA | 41ms | 81656kb | C++17 | 514b | 2024-05-04 21:13:34 | 2024-05-04 21:13:35 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int mod = 998244353;
const int N = 1e7 + 10;
ll f[N];
signed main()
{
f[0]=1;
f[1]=1;
for(int i=2;i<=N-1;i++){
f[i]=f[i-1]*i%mod;
}
int n;cin>>n;
ll ans=0;
for(ll i=1;i<=n;i++){
if(n-2*i+2>0){
ll bd=1;
for(ll j=n-2*i+2;j<=n-i;j++){
bd=bd*j%mod;
}
ans=ans+f[n-i]*bd%mod;
}
}
cout<<ans;
}
詳細信息
Test #1:
score: 100
Accepted
time: 38ms
memory: 81584kb
input:
1
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 41ms
memory: 81616kb
input:
2
output:
1
result:
ok 1 number(s): "1"
Test #3:
score: 0
Accepted
time: 41ms
memory: 81588kb
input:
10
output:
997920
result:
ok 1 number(s): "997920"
Test #4:
score: -100
Wrong Answer
time: 38ms
memory: 81656kb
input:
100
output:
23148519073
result:
wrong answer 1st numbers differ - expected: '188898954', found: '23148519073'