結果

問題 No.2219 Re:010
ユーザー titiatitia
提出日時 2023-02-17 23:10:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 305 bytes
コンパイル時間 700 ms
コンパイル使用メモリ 10,500 KB
実行使用メモリ 12,828 KB
最終ジャッジ日時 2023-09-26 20:33:03
合計ジャッジ時間 26,399 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
12,272 KB
testcase_01 AC 15 ms
7,968 KB
testcase_02 AC 15 ms
7,768 KB
testcase_03 AC 1,878 ms
8,172 KB
testcase_04 AC 58 ms
7,808 KB
testcase_05 AC 1,192 ms
8,168 KB
testcase_06 AC 120 ms
7,916 KB
testcase_07 AC 477 ms
8,084 KB
testcase_08 AC 1,649 ms
8,244 KB
testcase_09 AC 1,535 ms
8,256 KB
testcase_10 AC 929 ms
8,160 KB
testcase_11 AC 665 ms
8,036 KB
testcase_12 AC 686 ms
8,132 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 AC 109 ms
8,304 KB
testcase_19 AC 95 ms
8,348 KB
testcase_20 TLE -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

S=input().strip()
mod=998244353

A=0
z=0
zo=0
q=1

for s in S:
    if s=="0":
        z+=1*q
        A+=zo
    elif s=="1":
        zo+=z
    else:
        A=A+A+zo
        zo=zo+zo+z
        z=z+z+1*q
        q*=2
        
    A%=mod
    z%=mod
    zo%=mod
print(A)
0