結果

問題 No.975 ミスターマックスバリュ
ユーザー SSRSSSRS
提出日時 2020-08-05 07:35:45
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 591 bytes
コンパイル時間 578 ms
コンパイル使用メモリ 70,216 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-13 16:32:49
合計ジャッジ時間 1,681 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(){
	int X, N, M;
	cin >> X >> N >> M;
	vector<int> A(N);
	for (int i = 0; i < N; i++){
		cin >> A[i];
	}
	vector<int> B(M);
	for (int i = 0; i < M; i++){
		cin >> B[i];
	}
	bool a = false;
	for (int i = 0; i < N; i++){
		if (A[i] == X){
			a = true;
		}
	}
	bool b = false;
	for (int i = 0; i < M; i++){
		if (B[i] == X){
			b = true;
		}
	}
	if (a && b){
		cout << "MrMaxValu" << endl;
	} else if (a && !b){
		cout << "MrMax" << endl;
	} else if (!a && b){
		cout << "MaxValu" << endl;
	} else {
		cout << -1 << endl;
	}
}
0