結果

問題 No.975 ミスターマックスバリュ
ユーザー warm4C0warm4C0
提出日時 2022-08-16 23:01:01
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 568 bytes
コンパイル時間 2,580 ms
コンパイル使用メモリ 157,932 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-14 16:39:53
合計ジャッジ時間 2,297 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

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];
	}

	bool ok1, ok2;
	ok1 = ok2 = false;
	for (int i = 0; i < n; i++) {
		if (a[i] == x) {
			ok1 = true;
			break;
		}
	}
	for (int i = 0; i < m; i++) {
		if (b[i] == x) {
			ok2 = true;
			break;
		}
	}

	if (ok1 && ok2) {
		puts("MrMaxValu");
	} else if (ok1) {
		puts("MrMax");
	} else if (ok2) {
		puts("MaxValu");
	} else {
		puts("-1");
	}

	return 0;
}
0