結果
| 問題 |
No.2063 ±2^k operations (easy)
|
| コンテスト | |
| ユーザー |
やう
|
| 提出日時 | 2022-09-02 21:29:10 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 671 bytes |
| コンパイル時間 | 1,590 ms |
| コンパイル使用メモリ | 166,612 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-16 02:21:08 |
| 合計ジャッジ時間 | 2,400 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
using V=vector<ll>;
#define rep(i,n) for(ll i=0;i<n;i++)
#define REP(i,n) for(ll i=1;i<=n;i++)
int main(){
string s;
cin >> s;
int n=s.size(),count=0;
rep(i,n) if(s[i]=='1') count++;
if(count<=1){
cout << "No" << endl;
return 0;
}
if(count==2){
cout << "Yes" << endl;
return 0;
}
int i=0;
while(s[i]=='0') i++;
while(s[i]=='1') i++;
while(i<n){
if(s[i]=='1'){
cout << "No" << endl;
return 0;
}
i++;
}
cout << "Yes" << endl;
}
やう