結果

問題 No.975 ミスターマックスバリュ
ユーザー warm4C0
提出日時 2022-08-16 23:01:01
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 568 bytes
コンパイル時間 1,282 ms
コンパイル使用メモリ 158,964 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-03 17:02:54
合計ジャッジ時間 2,071 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

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