結果
問題 | No.2063 ±2^k operations (easy) |
ユーザー | lbm364dl |
提出日時 | 2022-09-16 17:01:47 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 2,656 bytes |
コンパイル時間 | 775 ms |
コンパイル使用メモリ | 76,072 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-21 13:53:55 |
合計ジャッジ時間 | 1,864 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,248 KB |
testcase_02 | AC | 2 ms
5,248 KB |
testcase_03 | AC | 2 ms
5,248 KB |
testcase_04 | AC | 2 ms
5,248 KB |
testcase_05 | AC | 2 ms
5,248 KB |
testcase_06 | AC | 2 ms
5,248 KB |
testcase_07 | AC | 2 ms
5,248 KB |
testcase_08 | AC | 2 ms
5,248 KB |
testcase_09 | AC | 2 ms
5,248 KB |
testcase_10 | AC | 2 ms
5,248 KB |
testcase_11 | AC | 2 ms
5,248 KB |
testcase_12 | AC | 2 ms
5,248 KB |
testcase_13 | AC | 2 ms
5,248 KB |
testcase_14 | AC | 2 ms
5,248 KB |
testcase_15 | AC | 2 ms
5,248 KB |
testcase_16 | AC | 2 ms
5,248 KB |
testcase_17 | AC | 2 ms
5,248 KB |
testcase_18 | AC | 3 ms
5,248 KB |
testcase_19 | AC | 2 ms
5,248 KB |
testcase_20 | AC | 3 ms
5,248 KB |
testcase_21 | AC | 2 ms
5,248 KB |
testcase_22 | AC | 3 ms
5,248 KB |
testcase_23 | AC | 3 ms
5,248 KB |
ソースコード
//#include <bits/stdc++.h> #include <iostream> #include <vector> #include <set> #include <map> #include <algorithm> //#include <ext/pb_ds/assoc_container.hpp> //using namespace __gnu_pbds; using namespace std; #define show(x) cerr << #x" = " << (x) << "\n" #define pb push_back #define pp pop_back #define mp make_pair #define fst first #define snd second #define FOR(var, from, to) for(int var = from; var < int(to); ++var) #define all(x) x.begin(), x.end() #define rev(x) x.rbegin(), x.rend() #define sz(x) int(x.size()) #define vec(x) vector<x> #define INF 2000000000 typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; //typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; // use unique second element of pair to work as multiset //typedef tree<pii,null_type,less<pii>,rb_tree_tag,tree_order_statistics_node_update> ordered_multiset; const ll mod = 1e9 + 7; template<typename T, typename U> ostream &operator<<(ostream &os, pair<T,U> p){os << "(" << p.fst << "," << p.snd << ")"; return os;} template<typename T, typename U> istream &operator>>(istream &is, pair<T,U> &p){is >> p.fst >> p.snd; return is;} template<typename T> istream &operator>>(istream &is, vector<T> &v){FOR(i, 0, v.size()) is >> v[i]; return is;} template<typename T> ostream &operator<<(ostream &os, vector<T> v){for(T x : v) os << x << " "; return os;} template<typename T> ostream &operator<<(ostream &os, set<T> s){for(T x : s) os << x << " "; return os;} //ostream &operator<<(ostream &os, ordered_set s){for(int x : s) os << x << " "; return os;} //ostream &operator<<(ostream &os, ordered_multiset s){for(pii x : s) os << x.fst << " "; return os;} template<typename T> ostream &operator<<(ostream &os, multiset<T> s){for(T x : s) os << x << " "; return os;} template<typename T, typename U> ostream &operator<<(ostream &os, map<T,U> m){for(auto x : m) os << x << " "; return os;} template<typename T> T sum(vector<T> v){T summ = 0; FOR(i, 0, sz(v)) summ += v[i]; return summ;} ll mod_pow(ll a, ll b){ ll sol = 1; while(b){ if(b&1){ sol = (sol*a)%mod; b--; }else{ a = (a*a)%mod; b/=2; } } return sol;} ll rem(ll a, ll b){ ll res = a%b; return res < 0 ? res+b : res; } void test_case(){ string s; cin >> s; int n = sz(s); int cnt = 0; for(char c : s) cnt += c == '1'; int cons = 1; FOR(i, 1, n) cons += s[i] == '1' && s[i-1] == '1'; if(cnt == 1){ cout << "No\n"; }else if(cons == cnt || cnt == 2){ cout << "Yes\n"; }else{ cout << "No\n"; } } int main(){ #ifndef DEBUG ios_base::sync_with_stdio(false); cin.tie(NULL); #endif int t = 1; FOR(i, 0, t) test_case(); return 0; }