結果
問題 |
No.3114 0→1
|
ユーザー |
![]() |
提出日時 | 2025-04-18 22:07:23 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 231 bytes |
コンパイル時間 | 242 ms |
コンパイル使用メモリ | 82,036 KB |
実行使用メモリ | 71,548 KB |
最終ジャッジ日時 | 2025-04-18 22:07:26 |
合計ジャッジ時間 | 2,589 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | WA * 30 |
ソースコード
N = int(input()) S = list(input()) cnt = 0 ans = 0 L = [0, 0, 1] for i in range(N): if(S[i] == "0"): cnt += 1 else: ans += (cnt // 3) * 2 + L[cnt % 3] cnt = 0 print(ans + (cnt // 3) * 2 + L[cnt % 3])