結果

問題 No.2219 Re:010
ユーザー ニックネームニックネーム
提出日時 2023-02-17 22:11:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 232 ms / 2,000 ms
コード長 259 bytes
コンパイル時間 760 ms
コンパイル使用メモリ 10,648 KB
実行使用メモリ 8,416 KB
最終ジャッジ日時 2023-09-26 19:27:15
合計ジャッジ時間 4,104 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,768 KB
testcase_01 AC 15 ms
7,848 KB
testcase_02 AC 16 ms
7,772 KB
testcase_03 AC 141 ms
8,060 KB
testcase_04 AC 31 ms
7,836 KB
testcase_05 AC 113 ms
8,152 KB
testcase_06 AC 42 ms
8,032 KB
testcase_07 AC 75 ms
8,168 KB
testcase_08 AC 131 ms
8,212 KB
testcase_09 AC 129 ms
8,176 KB
testcase_10 AC 103 ms
8,120 KB
testcase_11 AC 87 ms
8,036 KB
testcase_12 AC 89 ms
8,032 KB
testcase_13 AC 161 ms
8,332 KB
testcase_14 AC 159 ms
8,356 KB
testcase_15 AC 158 ms
8,268 KB
testcase_16 AC 161 ms
8,248 KB
testcase_17 AC 161 ms
8,288 KB
testcase_18 AC 128 ms
8,276 KB
testcase_19 AC 80 ms
8,200 KB
testcase_20 AC 232 ms
8,416 KB
testcase_21 AC 15 ms
7,848 KB
testcase_22 AC 15 ms
7,764 KB
testcase_23 AC 15 ms
7,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

dp = [1,0,0,0]; mod = 998244353
for v in input():
    if v!="1": dp[3] = (((v=="?")+1)*dp[3]+dp[2])%mod
    if v!="0": dp[2] = (((v=="?")+1)*dp[2]+dp[1])%mod
    if v!="1": dp[1] = (((v=="?")+1)*dp[1]+dp[0])%mod
    if v=="?": dp[0] = dp[0]*2%mod
print(dp[3])
0