結果

問題 No.1310 量子アニーリング
ユーザー AEnAEn
提出日時 2022-09-01 13:54:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 298 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 404 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 80,128 KB
最終ジャッジ日時 2024-04-26 16:04:36
合計ジャッジ時間 3,986 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,584 KB
testcase_01 AC 37 ms
51,712 KB
testcase_02 AC 36 ms
51,840 KB
testcase_03 AC 37 ms
51,968 KB
testcase_04 AC 37 ms
51,584 KB
testcase_05 AC 41 ms
51,584 KB
testcase_06 AC 36 ms
51,840 KB
testcase_07 AC 38 ms
51,712 KB
testcase_08 AC 37 ms
51,712 KB
testcase_09 AC 39 ms
51,968 KB
testcase_10 AC 39 ms
52,096 KB
testcase_11 AC 49 ms
60,544 KB
testcase_12 AC 59 ms
63,616 KB
testcase_13 AC 120 ms
72,064 KB
testcase_14 AC 151 ms
76,288 KB
testcase_15 AC 178 ms
78,464 KB
testcase_16 AC 183 ms
78,720 KB
testcase_17 AC 241 ms
80,128 KB
testcase_18 AC 297 ms
78,592 KB
testcase_19 AC 167 ms
78,208 KB
testcase_20 AC 101 ms
69,248 KB
testcase_21 AC 78 ms
66,304 KB
testcase_22 AC 298 ms
78,720 KB
testcase_23 AC 123 ms
72,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
mod = 998244353
fac = [0]*(N+1)
inv = [0]*(N+1)
fac[0], inv[0] = 1, 1
for i in range(1, N+1):
    fac[i] = fac[i-1]*i
    fac[i] %= mod
    inv[i] = inv[i-1]*pow(i, mod-2, mod)
    inv[i] %= mod
res = 0
for i in range(0, N+1, 2):
    res += 2*fac[N]*inv[i]*inv[N-i]*pow(2, abs(N-2*i), mod)
    res %= mod
print(res)
0