結果
問題 | No.2063 ±2^k operations (easy) |
ユーザー |
|
提出日時 | 2022-09-02 21:28:55 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 351 bytes |
コンパイル時間 | 1,832 ms |
コンパイル使用メモリ | 192,332 KB |
最終ジャッジ日時 | 2025-02-07 00:44:02 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include<bits/stdc++.h>using namespace std;int main(){ios::sync_with_stdio(false);cin.tie(nullptr);string N;cin>>N;int L=N.size(),cnt=0,f=1;for(int i=0;i<L;i++){if(N[i]=='1'){++cnt;if(f!=1)f=-1;}else{if(f==1)f=0;}}if(cnt==1||cnt>2&&f<0){cout<<"No\n";}else{cout<<"Yes\n";}}