結果

問題 No.975 ミスターマックスバリュ
ユーザー IlagIlag
提出日時 2020-03-20 20:26:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 676 bytes
コンパイル時間 1,565 ms
コンパイル使用メモリ 167,144 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-21 07:56:43
合計ジャッジ時間 2,320 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using PL = pair<ll, ll>;
// Welcome to my source code!

int main() {
    int x, n, m;
    cin >> x >> n >> m;
    int a[n], b[m];
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < m; i++) cin >> b[i];
    sort(a, a+n);
    sort(b, b+m);
    bool flag_a = false, flag_b = false;
    if (x == *lower_bound(a, a+n, x)) flag_a = true;
    if (x == *lower_bound(b, b+m, x)) flag_b = true;
    if (flag_a && flag_b) cout << "MrMaxValu" << endl;
    else if (flag_a) cout << "MrMax" << endl;
    else if (flag_b) cout << "MaxValu" << endl;
    else cout << -1 << endl;
}
0