結果

問題 No.1310 量子アニーリング
ユーザー H3PO4H3PO4
提出日時 2020-12-07 10:07:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 238 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 10,232 KB
最終ジャッジ日時 2023-10-17 15:59:53
合計ジャッジ時間 3,823 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,140 KB
testcase_01 AC 29 ms
10,140 KB
testcase_02 AC 29 ms
10,140 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 29 ms
10,140 KB
testcase_06 RE -
testcase_07 AC 29 ms
10,140 KB
testcase_08 AC 29 ms
10,140 KB
testcase_09 AC 29 ms
10,140 KB
testcase_10 RE -
testcase_11 AC 32 ms
10,140 KB
testcase_12 AC 47 ms
10,140 KB
testcase_13 AC 203 ms
10,140 KB
testcase_14 AC 285 ms
10,140 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 540 ms
10,140 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 151 ms
10,140 KB
testcase_21 AC 95 ms
10,140 KB
testcase_22 AC 727 ms
10,140 KB
testcase_23 AC 208 ms
10,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
MOD = 998244353
comb = 1
ans = 0

# 偶数で落ちた?
assert N % 2

for i in range(N + 1):
    ans += comb * pow(2, abs(N - 2 * i), MOD)
    ans %= MOD
    comb = comb * (N - i) * pow(i + 1, -1, MOD) % MOD
print(ans)
0