結果
問題 |
No.3114 0→1
|
ユーザー |
|
提出日時 | 2025-04-19 11:53:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 487 bytes |
コンパイル時間 | 2,124 ms |
コンパイル使用メモリ | 160,924 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-04-19 11:53:25 |
合計ジャッジ時間 | 2,902 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | WA * 30 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> P; #define REP(i,n) for(ll i=0;i<ll(n);i++) int main(void){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll i,j; ll N; string S; cin >> N >> S; ll ans=0; REP(i,N){ if(S[i]=='0'){ if(i+1<N){ if(S[i+1]=='0'){ ans++; } i++; } if(i+2<N){ if(S[i+2]=='0'){ ans++; } i++; } } } cout << ans << endl; return 0; }