結果
| 問題 |
No.975 ミスターマックスバリュ
|
| ユーザー |
|
| 提出日時 | 2020-01-31 21:37:37 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 592 ms / 2,000 ms |
| コード長 | 980 bytes |
| コンパイル時間 | 2,562 ms |
| コンパイル使用メモリ | 79,836 KB |
| 実行使用メモリ | 61,732 KB |
| 最終ジャッジ日時 | 2024-09-17 07:23:28 |
| 合計ジャッジ時間 | 5,259 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 |
ソースコード
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