結果

問題 No.975 ミスターマックスバリュ
ユーザー MisterMister
提出日時 2020-01-31 21:38:02
言語 C++17(clang)
(14.0.0 + boost 1.83.0)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 661 bytes
コンパイル時間 636 ms
コンパイル使用メモリ 83,100 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-20 13:47:48
合計ジャッジ時間 1,306 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 2 ms
4,384 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 7 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

void solve() {
    int x, n, m;
    std::cin >> x >> n >> m;

    int ans = 0;
    while (n--) {
        int a;
        std::cin >> a;
        if (x == a) ans |= 1;
    }

    while (m--) {
        int b;
        std::cin >> b;
        if (x == b) ans |= 2;
    }

    std::cout << (ans == 0 ? "-1"
                           : ans == 1 ? "MrMax"
                                      : ans == 2 ? "MaxValu"
                                                 : "MrMaxValu")
              << std::endl;
}

int main() {
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}
0