結果

問題 No.1310 量子アニーリング
ユーザー tekitoudatoutekitoudatou
提出日時 2020-12-11 00:47:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 274 ms / 2,000 ms
コード長 313 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 81,616 KB
実行使用メモリ 77,388 KB
最終ジャッジ日時 2023-10-20 01:10:37
合計ジャッジ時間 3,535 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,384 KB
testcase_01 AC 38 ms
53,384 KB
testcase_02 AC 39 ms
53,384 KB
testcase_03 AC 38 ms
53,384 KB
testcase_04 AC 38 ms
53,384 KB
testcase_05 AC 37 ms
53,384 KB
testcase_06 AC 38 ms
53,384 KB
testcase_07 AC 38 ms
53,384 KB
testcase_08 AC 38 ms
53,384 KB
testcase_09 AC 38 ms
53,384 KB
testcase_10 AC 39 ms
53,384 KB
testcase_11 AC 44 ms
59,416 KB
testcase_12 AC 71 ms
72,420 KB
testcase_13 AC 125 ms
76,448 KB
testcase_14 AC 149 ms
76,372 KB
testcase_15 AC 167 ms
76,328 KB
testcase_16 AC 174 ms
76,376 KB
testcase_17 AC 222 ms
76,860 KB
testcase_18 AC 274 ms
77,388 KB
testcase_19 AC 158 ms
76,396 KB
testcase_20 AC 109 ms
75,928 KB
testcase_21 AC 89 ms
73,696 KB
testcase_22 AC 271 ms
77,380 KB
testcase_23 AC 126 ms
76,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
mod=998244353
comb=1

pow2=[1]*(n+1)

def invmod(x):
    return pow(x,mod-2,mod)

for r in range(1,n+1):
    pow2[r]=(pow2[r-1]*2)%mod
ans=0
for r in range(n//2+1):
    ans+=comb*pow2[abs(4*r-n)]
    ans%=mod
    comb*=(n-2*r-1)*(n-2*r)*invmod(2*r+2)*invmod(2*r+1)
    comb%=mod

print((2*ans)%mod)
0