結果

問題 No.3015 右に寄せろ!
ユーザー nakanoj
提出日時 2025-01-25 14:26:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 449 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 82,356 KB
実行使用メモリ 78,720 KB
最終ジャッジ日時 2025-01-25 23:20:33
合計ジャッジ時間 3,652 ms
ジャッジサーバーID
(参考情報)
judge8 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

def readints():
  return list(map(int, input().split()))

def deep_recursion():
  import sys
  import pypyjit  # type: ignore
  sys.setrecursionlimit(550000)
  pypyjit.set_param('max_unroll_recursion=-1')

def main():
  S = map(int, input())
  ans = 0
  ones = 0
  for d in S:
    if d == 0:
      ans += ones // 2
      if ones < 2:
        ones = 0
    else:
      ones += 1
  print(ans)


if __name__ == '__main__':
  # deep_recursion()
  main()
0