結果

問題 No.3015 右に寄せろ!
ユーザー pitP
提出日時 2025-01-25 13:50:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 272 bytes
コンパイル時間 1,896 ms
コンパイル使用メモリ 81,536 KB
実行使用メモリ 171,788 KB
最終ジャッジ日時 2025-01-25 23:00:27
合計ジャッジ時間 4,626 ms
ジャッジサーバーID
(参考情報)
judge5 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

S = list(input())
N = len(S)
if N <= 2:
    exit(print(0))

ans = 0
wa = 0
for i in range(N - 1, -1, -1):

    if S[i] == '0':
        wa += 1
    else:
        if i + 3 <= N and S[i : i + 3] == ["1", "1", "0"]: 
            ans += wa
    
    # print(ans, wa)

print(ans)
0