結果

問題 No.2219 Re:010
ユーザー hiryuNhiryuN
提出日時 2023-02-17 21:46:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 297 bytes
コンパイル時間 474 ms
コンパイル使用メモリ 86,684 KB
実行使用メモリ 76,312 KB
最終ジャッジ日時 2023-09-26 19:02:11
合計ジャッジ時間 4,116 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,848 KB
testcase_01 AC 70 ms
70,848 KB
testcase_02 AC 72 ms
71,040 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 75 ms
75,732 KB
testcase_19 AC 77 ms
75,860 KB
testcase_20 WA -
testcase_21 AC 72 ms
71,044 KB
testcase_22 AC 71 ms
71,008 KB
testcase_23 AC 71 ms
71,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s=input()
M=998244353
key=pow(2,s.count("?")-3,M)
nex=s.count("?")+s.count("0")*2

pre=0
ans=0
for i in range(len(s)):
    if s[i]=="0":
        pre+=2
        nex-=2
    elif s[i]=="?":
        nex-=1
        ans+=(key*pre*nex)%M
        pre+=1
    else:
        ans+=(key*2*pre*nex)%M
print(ans)
0