結果
| 問題 | No.3114 0→1 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-04-18 21:35:52 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 59 ms / 2,000 ms |
| + 167µs | |
| コード長 | 264 bytes |
| 記録 | |
| コンパイル時間 | 94 ms |
| コンパイル使用メモリ | 64,936 KB |
| 実行使用メモリ | 68,136 KB |
| 最終ジャッジ日時 | 2026-10-21 08:10:50 |
| 合計ジャッジ時間 | 4,695 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
n = int(input())
s =list(input().rstrip())
ans = 0
for i in range(n):
if i-2 >= 0 and s[i-2] == '0' and s[i-1] == '1' and s[i] == '0':
s[i] = '1'
ans += 1
if i-1 >= 0 and s[i-1] == s[i] == '0':
s[i] = '1'
ans += 1
print(ans)