結果

問題 No.2063 ±2^k operations (easy)
ユーザー V_MelvilleV_Melville
提出日時 2022-09-02 22:29:24
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 552 bytes
コンパイル時間 3,958 ms
コンパイル使用メモリ 317,964 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-27 22:05:38
合計ジャッジ時間 3,681 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 WA -
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 1 ms
6,944 KB
testcase_12 AC 1 ms
6,940 KB
testcase_13 WA -
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 5 ms
6,944 KB
testcase_18 AC 4 ms
6,940 KB
testcase_19 AC 3 ms
6,944 KB
testcase_20 AC 3 ms
6,940 KB
testcase_21 WA -
testcase_22 AC 5 ms
6,944 KB
testcase_23 AC 5 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/extc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)

using namespace std;
using ll = long long;

int main() {
    string s;
    cin >> s;
    
    int cnt = 0;
    for (char c : s) {
        if (c == '1') cnt++;
    }
    
    if (cnt == 2) {
        puts("Yes");
        return 0;
    }
    
    int n = s.size();
    vector<int> pos;
    rep(i, n) {
        if (s[i] == '0') {
            pos.push_back(i);
        }
    }
    
    vector<int> a{n-2, n-1};
    if (pos == a) puts("Yes");
    else puts("No");
    
    return 0;
}
0