結果
| 問題 | 
                            No.2063 ±2^k operations (easy)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             kpinkcat
                         | 
                    
| 提出日時 | 2023-09-23 20:49:17 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 162 ms / 2,000 ms | 
| コード長 | 817 bytes | 
| コンパイル時間 | 1,963 ms | 
| コンパイル使用メモリ | 194,768 KB | 
| 最終ジャッジ日時 | 2025-02-17 01:48:08 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 21 | 
ソースコード
#include <bits/stdc++.h>
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
#include<string>
using ll = long long;
using namespace std;
int main()
{
    ll cnt = 0;
    string s;
    bool one = false, split = false;
    cin >> s;
    while(s.size()){
        if ((s[s.size() - 1] - '0')&1){
            cnt++;
            one = true;
        } else if (one){
            if (split && cnt == 2){
                cout << "No" << endl;
                return 0;
            }
            split = true;
            one = false;
        }
        if (cnt > 2 && split) {
            cout << "No" << endl;
            return 0;
        }
        s = s.substr(0, s.size() - 1);
    }
    cout << ((cnt >= 2) ? "Yes" : "No")<< endl;
}
            
            
            
        
            
kpinkcat