結果
| 問題 |
No.2063 ±2^k operations (easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-08-26 23:58:00 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 337 bytes |
| コンパイル時間 | 2,127 ms |
| コンパイル使用メモリ | 192,288 KB |
| 最終ジャッジ日時 | 2025-01-31 05:57:36 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin>>S;
int N=S.size(),iti=0,L=1e9,R=-1e9;
for(int i=0;i<N;i++)if(S[i]=='1'){
L=min(L,i);
R=max(R,i);
iti++;
}
bool OK=0;
if(iti<=2||R-L+1==iti)OK=1;
if(iti<=1)OK=0;
cout<<(OK?"Yes":"No")<<endl;
}