結果

問題 No.3114 0→1
ユーザー Mistletoe
提出日時 2025-04-19 00:19:07
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 218 bytes
コンパイル時間 375 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2025-04-19 00:19:11
合計ジャッジ時間 3,254 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input().strip()
count = 0
i = 0
while i < len(s) - 1:
    if s[i] == '0' and s[i+1] == '0':
        count += 1
        i += 2  # skip next to avoid overlapping
    else:
        i += 1
print(count)
0