結果

問題 No.1310 量子アニーリング
ユーザー 👑 KazunKazun
提出日時 2020-12-07 02:29:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 322 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 81,780 KB
実行使用メモリ 83,156 KB
最終ジャッジ日時 2023-10-17 15:53:09
合計ジャッジ時間 2,644 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,412 KB
testcase_01 AC 32 ms
53,412 KB
testcase_02 AC 32 ms
53,412 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 34 ms
53,412 KB
testcase_06 WA -
testcase_07 AC 35 ms
53,412 KB
testcase_08 AC 37 ms
53,412 KB
testcase_09 AC 33 ms
53,412 KB
testcase_10 WA -
testcase_11 AC 40 ms
62,004 KB
testcase_12 AC 45 ms
64,088 KB
testcase_13 AC 70 ms
71,180 KB
testcase_14 AC 87 ms
74,516 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 129 ms
83,156 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 62 ms
68,236 KB
testcase_21 AC 53 ms
65,300 KB
testcase_22 AC 137 ms
78,356 KB
testcase_23 AC 70 ms
71,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def nCr(n,r):
    return (F[n]*G[r]*G[n-r])%Mod
N=int(input())
Mod=998244353

F=[0]*(N+1)
F[0]=1
for i in range(1,N+1):
    F[i]=(i*F[i-1])%Mod

G=[0]*(N+1)
G[N]=pow(F[N],Mod-2,Mod)
for k in range(N-1,-1,-1):
    G[k]=(G[k+1]*(k+1))%Mod

S=0
for k in range(0,N+1):
    S+=pow(2,abs(2*k-N),Mod)*nCr(N,k)
    S%=Mod
print(S)
0