結果

問題 No.975 ミスターマックスバリュ
ユーザー ks2mks2m
提出日時 2020-01-31 21:28:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 159 ms / 2,000 ms
コード長 874 bytes
コンパイル時間 2,125 ms
コンパイル使用メモリ 77,108 KB
実行使用メモリ 60,056 KB
最終ジャッジ日時 2023-10-17 08:43:55
合計ジャッジ時間 3,590 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
53,492 KB
testcase_01 AC 55 ms
52,420 KB
testcase_02 AC 55 ms
53,496 KB
testcase_03 AC 56 ms
53,488 KB
testcase_04 AC 55 ms
53,500 KB
testcase_05 AC 60 ms
53,532 KB
testcase_06 AC 59 ms
53,512 KB
testcase_07 AC 63 ms
53,528 KB
testcase_08 AC 159 ms
60,056 KB
testcase_09 AC 55 ms
53,496 KB
testcase_10 AC 54 ms
53,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		int x = Integer.parseInt(sa[0]);
		int n = Integer.parseInt(sa[1]);
		int m = Integer.parseInt(sa[2]);

		boolean flg = false;
		sa = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
			if (x == Integer.parseInt(sa[i])) {
				flg = true;
				break;
			}
		}
		sa = br.readLine().split(" ");
		for (int i = 0; i < m; i++) {
			if (x == Integer.parseInt(sa[i])) {
				if (flg) {
					System.out.println("MrMaxValu");
				} else {
					System.out.println("MaxValu");
				}
				return;
			}
		}
		br.close();

		if (flg) {
			System.out.println("MrMax");
		} else {
			System.out.println("-1");
		}
	}
}
0