QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#19751#1089. Biological Software UtilitieswlzhouzhuanAC ✓5ms3720kbC++171.4kb2022-02-10 14:14:102022-05-06 06:58:50

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-06 06:58:50]
  • 评测
  • 测评结果:AC
  • 用时:5ms
  • 内存:3720kb
  • [2022-02-10 14:14:10]
  • 提交

answer

// Author: wlzhouzhuan
#include<bits/stdc++.h>
using namespace std;

#define rep(i,l,r) for(int i=(l);i<=(r);i++)
#define per(i,l,r) for(int i=(l);i>=(r);i--)
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define mset(s,t) memset(s,t,sizeof(s))
#define mcpy(s,t) memcpy(s,t,sizeof(t))
#define SZ(x) ((int)x.size())
#define pb push_back
#define eb emplace_back
#define fir first
#define sec second

template<class T1,class T2>bool ckmax(T1 &a,T2 b){if(a<b)return a=b,1;else return 0;}
template<class T1,class T2>bool ckmin(T1 &a,T2 b){if(a>b)return a=b,1;else return 0;}

inline int read(){
    int x=0,f=0;char ch=getchar();
    while(!isdigit(ch))f|=ch=='-',ch=getchar();
    while(isdigit(ch))x=10*x+ch-'0',ch=getchar();
    return f?-x:x;
}
template<typename T>void print(T x){
    if(x<0)putchar('-'),x=-x;
    if(x>=10)print(x/10);
    putchar(x%10+'0');
}
template<typename T>void print(T x,char ch){
    print(x),putchar(ch);
}

const int mod=998244353;

int qpow(int a,int b=mod-2){
    int res=1;
    while(b>0){
        if(b&1)res=1ll*res*a%mod;
        a=1ll*a*a%mod,b>>=1;
    }
    return res;
}

int n;

int main(){
    cin>>n;
    int ans=1;
    if(n&1)return puts("0"),0;
    if(n==2)return puts("1"),0;
    for(int i=n-1;i>=1;i-=2)ans=1ll*ans*i%mod;
    ans=1ll*ans*qpow(n,n/2-2)%mod*qpow(2,n/2)%mod;
    cout<<ans<<'\n';
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3588kb

input:

1

output:

0

result:

ok 1 number(s): "0"

Test #2:

score: 0
Accepted
time: 2ms
memory: 3596kb

input:

2

output:

1

result:

ok 1 number(s): "1"

Test #3:

score: 0
Accepted
time: 3ms
memory: 3520kb

input:

3

output:

0

result:

ok 1 number(s): "0"

Test #4:

score: 0
Accepted
time: 1ms
memory: 3568kb

input:

4

output:

12

result:

ok 1 number(s): "12"

Test #5:

score: 0
Accepted
time: 3ms
memory: 3716kb

input:

7788

output:

178152092

result:

ok 1 number(s): "178152092"

Test #6:

score: 0
Accepted
time: 5ms
memory: 3448kb

input:

1000000

output:

178454094

result:

ok 1 number(s): "178454094"

Test #7:

score: 0
Accepted
time: 3ms
memory: 3588kb

input:

12346

output:

751958800

result:

ok 1 number(s): "751958800"

Test #8:

score: 0
Accepted
time: 5ms
memory: 3720kb

input:

999996

output:

690785929

result:

ok 1 number(s): "690785929"

Test #9:

score: 0
Accepted
time: 3ms
memory: 3716kb

input:

6

output:

720

result:

ok 1 number(s): "720"

Test #10:

score: 0
Accepted
time: 3ms
memory: 3592kb

input:

10

output:

30240000

result:

ok 1 number(s): "30240000"

Test #11:

score: 0
Accepted
time: 0ms
memory: 3452kb

input:

99

output:

0

result:

ok 1 number(s): "0"

Test #12:

score: 0
Accepted
time: 4ms
memory: 3592kb

input:

100

output:

934178078

result:

ok 1 number(s): "934178078"

Test #13:

score: 0
Accepted
time: 3ms
memory: 3652kb

input:

20

output:

245111072

result:

ok 1 number(s): "245111072"

Test #14:

score: 0
Accepted
time: 2ms
memory: 3644kb

input:

38745

output:

0

result:

ok 1 number(s): "0"

Test #15:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

3848

output:

928659530

result:

ok 1 number(s): "928659530"

Test #16:

score: 0
Accepted
time: 2ms
memory: 3592kb

input:

347835

output:

0

result:

ok 1 number(s): "0"

Test #17:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

234234

output:

745247398

result:

ok 1 number(s): "745247398"

Test #18:

score: 0
Accepted
time: 3ms
memory: 3568kb

input:

12

output:

818069491

result:

ok 1 number(s): "818069491"

Test #19:

score: 0
Accepted
time: 3ms
memory: 3564kb

input:

98

output:

648803799

result:

ok 1 number(s): "648803799"

Test #20:

score: 0
Accepted
time: 3ms
memory: 3676kb

input:

124

output:

159487965

result:

ok 1 number(s): "159487965"

Test #21:

score: 0
Accepted
time: 3ms
memory: 3568kb

input:

1024

output:

318674437

result:

ok 1 number(s): "318674437"

Test #22:

score: 0
Accepted
time: 4ms
memory: 3540kb

input:

524288

output:

495260023

result:

ok 1 number(s): "495260023"

Test #23:

score: 0
Accepted
time: 3ms
memory: 3572kb

input:

524289

output:

0

result:

ok 1 number(s): "0"

Test #24:

score: 0
Accepted
time: 3ms
memory: 3452kb

input:

999999

output:

0

result:

ok 1 number(s): "0"

Test #25:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

999997

output:

0

result:

ok 1 number(s): "0"