QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#360531 | #6736. Alice and Bob | sheppard23 | WA | 1ms | 3536kb | C++14 | 1.0kb | 2024-03-21 21:06:10 | 2024-03-21 21:06:11 |
Judging History
answer
#include<iostream>
#include<algorithm>
#include<math.h>
#include<vector>
#include<set>
#include<cstring>
#include<map>
#include<unordered_map>
#include<queue>
#define x first
#define y second
#define int long long
#define fast ios::sync_with_stdio(false);cin.tie(0);
#define Endl endl
using namespace std;
const int N = 1e7 + 10;
const int mod=998244353;
int fac[N];
int qmid(int a,int b)
{
int res=1;
while(b)
{
if(b&1)
res=res*a%mod;
a=a*a%mod;
b>>=1;
}
return res;
}
void solve()
{
int n;
cin>>n;
fac[0]=1;
for(int i=1;i<=n;i++)
{
fac[i]=fac[i-1]*i%mod;
}
int ans=0;
for(int i=1;n>=2*i-1;i++)
{
int t=fac[n-i]%mod*fac[n-i]%mod*qmid(fac[n-2*i+1],mod-2);
ans=(ans+t%mod)%mod;
cout<<ans<<endl;
}
cout<<ans<<endl;
}
signed main()
{
fast;
int tt = 1;
//cin >> tt;
while (tt--)
{
solve();
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3536kb
input:
1
output:
1 1
result:
wrong answer Output contains longer sequence [length = 2], but answer contains 1 elements