結果

問題 No.2397 ω冪
ユーザー CyanmondCyanmond
提出日時 2023-07-28 23:49:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,337 bytes
コンパイル時間 2,508 ms
コンパイル使用メモリ 201,300 KB
実行使用メモリ 818,060 KB
最終ジャッジ日時 2024-04-16 07:44:57
合計ジャッジ時間 5,277 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
5,248 KB
testcase_03 WA -
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 WA -
testcase_07 MLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
// #include "atcoder/modint"

using i64 = long long;
// using Fp = atcoder::modint998244353;

std::pair<i64, i64> decomp(i64 n) {
    assert(n >= 1);
    i64 b = 0;
    while (true) {
        if (n & (1 << b)) {
            break;
        }
        ++b;
    }
    i64 a = n / (1 << b);
    assert(a % 2 == 1);
    a /= 2;
    return {a, b};
}

int main() {
    std::string N, M;
    std::cin >> N >> M;
    if (N == M) {
        std::cout << "No" << std::endl;
    } else if (N == "0") {
        std::cout << "Yes" << std::endl;
    } else if (M == "0") {
        std::cout << "No" << std::endl;
    }
    int nma = 0, mma = 0;
    std::vector<int> x, y;
    {
        int last = 0;
        for (int i = 0; i < (int)N.size() - 1; ++i) {
            if (N[i] == '1') {
                x.push_back(i - last);
                last = i + 1;
            }
        }
        x.push_back(N.size() - last);
    }
    {
        int last = 0;
        for (int i = 0; i < (int)M.size() - 1; ++i) {
            if (M[i] == '1') {
                y.push_back(i - last);
                last = i = 1;
            }
        }
        y.push_back(M.size() - last);
    }
    std::sort(x.begin(), x.end(), std::greater());
    std::sort(y.begin(), y.end(), std::greater());
    std::cout << (y > x ? "Yes" : "No") << std::endl;
}
0