結果

問題 No.884 Eat and Add
ユーザー pluto77
提出日時 2020-06-13 10:00:33
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 111 ms / 1,000 ms
コード長 192 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 12,480 KB
最終ジャッジ日時 2024-06-24 21:24:24
合計ジャッジ時間 1,612 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki884
n=list('00'+input())
res=0
for i in range(1,len(n))[::-1]:
 if n[i]=='1':
  n[i]='0'
  i-=1
  if n[i]=='1':
   while n[i]=='1':
    n[i]='0'
    i-=1
   n[i]='1'
  res+=1
print(res) 
0