結果

問題 No.975 ミスターマックスバリュ
ユーザー tokutarotokutaro
提出日時 2020-03-06 18:16:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 737 bytes
コンパイル時間 727 ms
コンパイル使用メモリ 72,468 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 04:03:09
合計ジャッジ時間 1,233 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int X, N, M;
    cin >> X;
    cin >> N;
    cin >> M;
    int tmp;
    vector<int> vc_N, vc_M;
    for (int i = 0; i < N; i++) {
        cin >> tmp;
        vc_N.push_back(tmp);
    }
    for (int i = 0; i < M; i++) {
        cin >> tmp;
        vc_M.push_back(tmp);
    }
    int cnt_N = count(vc_N.begin() ,vc_N.end(), X);
    int cnt_M = count(vc_M.begin(), vc_M.end(), X);

    if (cnt_N > 0 && cnt_M > 0) {
        cout << "MrMaxValu" << "\n";
    } else if (cnt_N > 0) {
        cout << "MrMax" << "\n";
    } else if (cnt_M > 0) {
        cout << "MaxValu" << "\n";
    } else {
        cout << "-1" << "\n";
    }

    return 0;
}
0