結果

問題 No.975 ミスターマックスバリュ
ユーザー 37zigen37zigen
提出日時 2020-01-31 21:37:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 519 ms / 2,000 ms
コード長 980 bytes
コンパイル時間 2,479 ms
コンパイル使用メモリ 79,296 KB
実行使用メモリ 64,324 KB
最終ジャッジ日時 2023-10-17 08:56:01
合計ジャッジ時間 5,406 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
57,380 KB
testcase_01 AC 139 ms
57,608 KB
testcase_02 AC 146 ms
57,632 KB
testcase_03 AC 143 ms
57,040 KB
testcase_04 AC 152 ms
57,584 KB
testcase_05 AC 196 ms
57,764 KB
testcase_06 AC 196 ms
57,568 KB
testcase_07 AC 207 ms
59,952 KB
testcase_08 AC 519 ms
64,324 KB
testcase_09 AC 135 ms
55,396 KB
testcase_10 AC 135 ms
57,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;

// This file is a "Hello, world!" in Java language by OpenJDK for wandbox.

class Main
{
	public static void main(String[] args)
	{
		new Main().run();
	}
	
	void run(){
		Scanner sc=new Scanner(System.in);
		HashSet<Integer> m1=new HashSet<>();
		HashSet<Integer> m2=new HashSet<>();
		int X=sc.nextInt();
		int N=sc.nextInt();
		int M=sc.nextInt();
		for(int i=0;i<N;++i)m1.add(sc.nextInt());
		for(int i=0;i<M;++i)m2.add(sc.nextInt());
		if(m1.contains(X)&&m2.contains(X)){
			System.out.println("MrMaxValu");
		}else if(!m1.contains(X)&&!m2.contains(X)){
			System.out.println(-1);
		}else if(m1.contains(X)){
			System.out.println("MrMax");
		}else if(m2.contains(X)){
			System.out.println("MaxValu");
		}else{
			throw new AssertionError();
		}
	}
	
	void tr(Object...o){System.out.println(Arrays.deepToString(o));}
}
// OpenJDK reference:
//   http://openjdk.java.net/

// Java language references:
//   http://docs.oracle.com/javase
0