結果

問題 No.1694 ZerOne
ユーザー titiatitia
提出日時 2021-10-02 00:18:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 472 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 10,996 KB
実行使用メモリ 8,004 KB
最終ジャッジ日時 2023-09-27 00:31:00
合計ジャッジ時間 2,664 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,848 KB
testcase_01 AC 15 ms
7,852 KB
testcase_02 AC 15 ms
7,912 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 15 ms
7,844 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 15 ms
7,912 KB
testcase_12 AC 15 ms
7,904 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 15 ms
7,864 KB
testcase_19 AC 15 ms
7,848 KB
testcase_20 AC 16 ms
7,848 KB
testcase_21 AC 16 ms
7,848 KB
testcase_22 AC 17 ms
7,908 KB
testcase_23 AC 16 ms
7,764 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 16 ms
7,848 KB
testcase_29 AC 16 ms
7,952 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

S=input().strip()
LEN=len(S)

DP=[[0]*(62) for i in range(LEN+2)]

DP[0][31]=1

for i in range(LEN+2):
    for j in range(62):
        DP[i][j]+=DP[i-1][j]

    if i<LEN-1:
        if S[i]=="0" and S[i+1]=="1":
            for j in range(61,-1,-1):
                DP[i+2][j]+=DP[i][j-1]

        if S[i]=="1" and S[i+1]=="0":
            for j in range(61):
                DP[i+2][j]+=DP[i][j+1]
        


ANS=0
print(DP[-1][31])
0