QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#408267 | #6736. Alice and Bob | mxxnez | WA | 1ms | 3524kb | C++17 | 633b | 2024-05-09 22:09:13 | 2024-05-09 22:09:20 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define i64 long long
const i64 MOD = 998244353;
const i64 N = 1e7 + 7;
i64 fac[N];
void solve(){
i64 n;
cin >> n;
fac[1] = 1;
for(i64 i = 2 ; i <= n ; i++){
fac[i] = fac[i-1] * i % MOD;
}
i64 ans = 0 ;
i64 on = n - 1;
i64 un = n - 1;
for(i64 i = n - 1 ; i >= (1+n)/2; i--){
ans = (ans + (fac[on] / fac[un]) * fac[i]) % MOD ;
on -- ;
un = un - 2;
}
cout << ans << "\n";
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t=1;
//cin>>t;
while(t--){
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3524kb
input:
1
output:
0
result:
wrong answer 1st numbers differ - expected: '1', found: '0'