結果

問題 No.3015 右に寄せろ!
コンテスト
ユーザー titia
提出日時 2025-02-03 03:37:44
言語 Python3
(3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 574 ms / 2,000 ms
+ 107µs
コード長 262 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 406 ms
コンパイル使用メモリ 14,720 KB
実行使用メモリ 14,464 KB
最終ジャッジ日時 2026-11-15 19:58:24
合計ジャッジ時間 7,496 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

S=input()

now=0
ANS=0

for i in range(1,len(S)):
    #print(now)
    if now<=1 and S[i]==S[i-1]=="1":
        now=2
        continue

    if now>=2 and S[i]=="1":
        now+=1

    if now>=2 and S[i]=="0":
        now=now//2*2
        ANS+=now//2

print(ANS)
0