結果

問題 No.3015 右に寄せろ!
ユーザー moon17
提出日時 2025-02-08 18:19:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 229 bytes
コンパイル時間 435 ms
コンパイル使用メモリ 82,188 KB
実行使用メモリ 187,544 KB
最終ジャッジ日時 2025-02-08 18:19:35
合計ジャッジ時間 6,049 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

s=[*input()]
while s and s[-1]=='1':
  s.pop()
ans=z=0
while s:
  while s and s[-1]=='0':
    s.pop()
    z+=1
  while s and s[-2:]==[*'11']:
    ans+=z
    s.pop();s.pop()
  while s and s[-1]=='1':
    z=0
    s.pop()
print(ans)
0