結果
| 問題 | 
                            No.2063 ±2^k operations (easy)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-09-02 21:50:13 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,609 bytes | 
| コンパイル時間 | 1,953 ms | 
| コンパイル使用メモリ | 194,484 KB | 
| 最終ジャッジ日時 | 2025-02-07 01:06:26 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 WA * 3 | 
ソースコード
#include <bits/stdc++.h>
// clang-format off
using namespace std; using ll=long long; using ull=unsigned long long; using pll=pair<ll,ll>; const ll INF=4e18;
void print0(){}; template<typename H,typename... T> void print0(H h,T... t){cout<<h;print0(t...);}
void print(){print0("\n");}; template<typename H,typename... T>void print(H h,T... t){print0(h);if(sizeof...(T)>0)print0(" ");print(t...);}
void perr0(){}; template<typename H,typename... T> void perr0(H h,T... t){cerr<<h;perr0(t...);}
void perr(){perr0("\n");}; template<typename H,typename... T>void perr(H h,T... t){perr0(h);if(sizeof...(T)>0)perr0(" ");perr(t...);}
void ioinit() { cout<<fixed<<setprecision(15); cerr<<fixed<<setprecision(6); ios_base::sync_with_stdio(0); cin.tie(0); }
// clang-format on
int main() {
    ioinit();
    string s;
    cin >> s;
    int pc = 0;
    int zpc = 0;
    for (auto c : s) {
        if (c == '1') {
            pc++;
        } else {
            zpc++;
        }
    }
    if (pc == 0) {
        print("No");
        return 0;
    }
    if (pc == 1) {
        print("No");
        return 0;
    }
    if (zpc == 0) {
        print("No");
        return 0;
    }
    if (zpc == 1) {
        print("Yes");
        return 0;
    }
    if (pc == 2) {
        print("Yes");
        return 0;
    }
    int st = 0;
    for (int i = 1; i < s.size(); i++) {
        if (s[i - 1] == '1' && s[i] == '0') {
            st++;
        } else if (s[i - 1] == '0' && s[i] == '1') {
            st += 100;
        }
    }
    if (st == 1) {
        print("Yes");
        return 0;
    }
    print("No");
    return 0;
}