結果
| 問題 | No.3114 0→1 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-04-19 17:25:53 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 318 bytes |
| コンパイル時間 | 3,330 ms |
| コンパイル使用メモリ | 274,088 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-04-19 17:25:58 |
| 合計ジャッジ時間 | 4,806 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 WA * 4 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
string s ;
cin >> n >> s;
int sum = 0;
for(int i = 0; i < n - 2; i++)
{
if(s[i] == '0' && s[i + 2] == '0')
{
sum++;
s[i + 2] = '1';
}
if(s[i] == '0' && s[i + 1] == '0')
{
sum++;
s[i + 1] = '1';
}
}
cout << sum << endl;
}