結果
問題 |
No.3114 0→1
|
ユーザー |
![]() |
提出日時 | 2025-04-21 14:57:02 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 455 bytes |
コンパイル時間 | 3,447 ms |
コンパイル使用メモリ | 273,424 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-04-21 14:57:07 |
合計ジャッジ時間 | 5,149 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | WA * 30 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S; cin >> S; int ans = 0; for (int i = 0; i < N - 1; i++) { if (S[i] == '0' && S[i + 1] == '0') { S[i] == '1'; ans++; } } for (int i = 0; i < N - 2; i++) { if (S[i] == '0' && S[i + 1] == '1' && S[i + 2] == '0') { ans++; } } cout << ans; }