結果
| 問題 | No.3114 0→1 |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-04-19 07:56:25 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 59 ms / 2,000 ms |
| コード長 | 269 bytes |
| 記録 | |
| コンパイル時間 | 302 ms |
| コンパイル使用メモリ | 82,336 KB |
| 実行使用メモリ | 70,144 KB |
| 最終ジャッジ日時 | 2025-04-19 07:56:31 |
| 合計ジャッジ時間 | 3,522 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
N = int(input())
S = input()
xs = [int(c) for c in S]
ans = 0
for i in range(N):
if xs[i] == 0:
if i > 0 and xs[i-1] == 0:
xs[i] = 1
ans += 1
if i > 1 and xs[i-2] == 0:
xs[i] = 1
ans += 1
print(ans)
norioc