QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#404885#6736. Alice and Bobqzuser#WA 41ms81656kbC++17514b2024-05-04 21:13:342024-05-04 21:13:35

Judging History

你现在查看的是最新测评结果

  • [2024-05-04 21:13:35]
  • 评测
  • 测评结果:WA
  • 用时:41ms
  • 内存:81656kb
  • [2024-05-04 21:13:34]
  • 提交

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'