結果
問題 |
No.3114 0→1
|
ユーザー |
|
提出日時 | 2025-05-05 13:41:41 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 654 bytes |
コンパイル時間 | 3,561 ms |
コンパイル使用メモリ | 279,756 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-05-05 13:41:47 |
合計ジャッジ時間 | 5,234 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 WA * 6 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll=long long; vector<string> S; ll N; void dfs(ll N,string R){ if(R.size()==N){ int e=0; for(int i=0;i<N;i++)e|=(1<<(R[i]-'A')); if(e==7)S.push_back(R); return; } for(int i=0;i<3;i++){ R.push_back('A'+i); dfs(N,R); R.pop_back(); } return; } void solve(){ ll an=0; ll N; string S; cin>>N>>S; for(int i=0;i<N;i++){ if(i>1&&S.substr(i-1,2)=="00"){ an++; S[i]='1'; } if(i>2&&S.substr(i-2,3)=="010"){ an++; S[i]='1'; } } cout<<an<<endl; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll T=1; // cin>>T; while(T--) solve(); }