QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#694227 | #6749. Target | zxk# | WA | 0ms | 3628kb | C++17 | 699b | 2024-10-31 17:30:46 | 2024-10-31 17:30:50 |
Judging History
answer
#include <iostream>
using namespace std;
const int mod=998244353;
int pre[10000001];
inline int quick_pow(int base,int index)
{
long long ans=1,tmp=base;
while(index){
if(index&1){
ans*=tmp;
ans%=mod;
}
tmp*=tmp;
tmp%=mod;
index>>=1;
}
return ans;
}
int get_inv(int x)
{
return quick_pow(x,mod-2);
}
int get_CC(int down,int up)
{
return 1ll*pre[down]*get_inv(pre[down-up])%mod;
}
signed main()
{
int n;
cin>>n;
pre[0]=1;
for(int i=1;i<=n;i++){
pre[i]=1ll*pre[i-1]*i%mod;
}
int ans=0;
for(int i=1;i<=(n+1)/2;i++){
ans+=1ll*pre[n-i]*get_CC(n-i,i-1)%mod;
ans%=mod;
}
cout<<ans;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3628kb
input:
0.5 0.25
output:
0
result:
wrong answer wa