結果

問題 No.2397 ω冪
ユーザー CyanmondCyanmond
提出日時 2023-07-28 23:57:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,116 bytes
コンパイル時間 2,333 ms
コンパイル使用メモリ 201,528 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-16 07:51:36
合計ジャッジ時間 3,739 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

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

int main() {
    std::string N, M;
    std::cin >> N >> M;
    if (N == M) {
        std::cout << "No" << std::endl;
        return 0;
    } else if (N == "0") {
        std::cout << "Yes" << std::endl;
        return 0;
    } else if (M == "0") {
        std::cout << "No" << std::endl;
        return 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