結果
| 問題 |
No.2063 ±2^k operations (easy)
|
| コンテスト | |
| ユーザー |
_yurimoir
|
| 提出日時 | 2022-10-18 11:41:22 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 839 bytes |
| コンパイル時間 | 3,274 ms |
| コンパイル使用メモリ | 249,764 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 20:31:08 |
| 合計ジャッジ時間 | 4,401 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 WA * 2 RE * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int n=(int)s.size();
vector<vector<pair<int,int>>> tank(2);
int l=0;
char c=s[0];
for(int i=1;i<n;i++){
if(s[i]!=c){
tank[c-'0'].push_back({l,i});
l=i;
c=s[i];
}
if(i==n-1){
tank[s[i]-'0'].push_back({n,l});
}
}
if(tank[1].size()>2){
cout<<"No"<<endl;
}else if(tank[1].size()==2){
for(int i=0;i<2;i++){
if(tank[1][i].second-tank[1][i].first==1)continue;
cout<<"No"<<endl;
return 0;
}
cout<<"Yes"<<endl;
return 0;
}else{
if(tank[1][0].second-tank[1][0].first==1){
cout<<"No"<<endl;
return 0;
}
cout<<"Yes"<<endl;
}
}
_yurimoir