結果

問題 No.3015 右に寄せろ!
ユーザー titia
提出日時 2025-02-03 03:37:44
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 981 ms / 2,000 ms
コード長 262 bytes
コンパイル時間 387 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 14,208 KB
最終ジャッジ日時 2025-02-03 03:37:55
合計ジャッジ時間 9,855 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

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