結果

問題 No.3114 0→1
ユーザー ArcAki
提出日時 2025-05-13 10:53:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 228 bytes
コンパイル時間 550 ms
コンパイル使用メモリ 82,592 KB
実行使用メモリ 95,700 KB
最終ジャッジ日時 2025-05-13 10:53:15
合計ジャッジ時間 4,539 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = list(input())
pre = s[0]
cnt = 0
t = []
for c in s:
	if pre==c:
		cnt += 1 
	else:
		t.append((pre, cnt))
		pre = c
		cnt = 1 
t.append((pre, cnt))
ans = 0
for c, v in t:
	if c=="0":
		ans += v-1
print(ans)
0