結果
| 問題 |
No.884 Eat and Add
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2020-11-01 09:13:32 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 154 ms / 1,000 ms |
| コード長 | 284 bytes |
| コンパイル時間 | 231 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 14,048 KB |
| 最終ジャッジ日時 | 2024-07-22 05:39:02 |
| 合計ジャッジ時間 | 1,787 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
N = [0] + [int(i) for i in input()]
ans = 0
while N:
if N[-1]==0: N.pop()
elif len(N)==1: ans += 1; N.pop()
elif N[-1]==1 and N[-2]==0:
ans += 1
N.pop()
else:
ans += 1
while N[-1]==1:
N.pop()
N[-1] = 1
print(ans)
convexineq