結果
| 問題 | No.3114 0→1 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-04-16 00:01:54 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 86 ms / 2,000 ms |
| + 675µs | |
| コード長 | 270 bytes |
| 記録 | |
| コンパイル時間 | 571 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 13,304 KB |
| 最終ジャッジ日時 | 2026-10-21 07:41:37 |
| 合計ジャッジ時間 | 4,511 ms |
|
ジャッジサーバーID (参考情報) |
judge6_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
n = int(input())
s = input()
s = list(s)
ans = 0
for i in range(n):
if i >= 1 and s[i] == '0' and s[i-1] == '0':
s[i] = '1'
ans += 1
if i >= 2 and s[i] == '0' and s[i-1] == '1' and s[i-2] == '0':
s[i] = '1'
ans += 1
print(ans)