結果
問題 | No.2063 ±2^k operations (easy) |
ユーザー |
![]() |
提出日時 | 2022-09-03 12:31:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 18 ms / 2,000 ms |
コード長 | 1,250 bytes |
コンパイル時間 | 4,161 ms |
コンパイル使用メモリ | 252,300 KB |
最終ジャッジ日時 | 2025-02-07 02:13:40 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h>using namespace std;#include <atcoder/all>using namespace atcoder;#define rep(i, n) for (int i = 0; i < (int)(n); i++)#define rep1(i, n) for (int i = 1; i < (int)(n+1); i++)#define repn(i,a,b) for (int i = (int)(a) ; i < (int)(b+1); i++)#define repv(i, n) for (int i = (int)(n-1); i >= 0; i--)#define all(x) (x).begin(),(x).end()#define rall(x) (x).rbegin(),(x).rend()#define sz(x) ((int)(x).size())#define cauto const auto&#define bit(n) (1LL<<(n))#define uni(v) v.erase( unique(v.begin(), v.end()), v.end() );using ll = long long;using P = pair<int,int>;using PP = pair<int, P>;using Graph = vector<vector<int>>;using mint = modint998244353;#ifdef LOCAL#include <debug.hpp>#define debug(...) debug::multi_print(#__VA_ARGS__, __VA_ARGS__)#else#define debug(...) (static_cast<void>(0))#endifint main(){string s;cin >> s;int cnt_1 = 0;if(s[sz(s)-1] == '1') cnt_1++;bool ok = true;rep(i,sz(s)-1){if(s[i] == '1') cnt_1++;if(s[i] == '0' && s[i+1] == '1'){ok = false;}}if(cnt_1 == 2){ok = true;} else if(cnt_1 == 1){ok = false;}cout << (ok ? "Yes" : "No") << endl;return 0;}