結果

問題 No.2397 ω冪
ユーザー Cyanmond
提出日時 2023-07-28 23:49:43
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,337 bytes
コンパイル時間 1,856 ms
コンパイル使用メモリ 199,628 KB
最終ジャッジ日時 2025-02-15 20:45:42
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 4 MLE * 1 -- * 33
権限があれば一括ダウンロードができます

ソースコード

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