結果

問題 No.975 ミスターマックスバリュ
ユーザー CuriousFairy315
提出日時 2020-01-31 21:53:55
言語 Java
(openjdk 23)
結果
AC  
実行時間 519 ms / 2,000 ms
コード長 869 bytes
コンパイル時間 2,208 ms
コンパイル使用メモリ 74,752 KB
実行使用メモリ 47,868 KB
最終ジャッジ日時 2024-09-17 08:00:54
合計ジャッジ時間 4,974 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        new Main();
    }
    
    public Main() {
        try (Scanner sc = new Scanner(System.in)) {
            int X = sc.nextInt(), N = sc.nextInt(), M = sc.nextInt();
            int find = 0;
            for (int i = 0;i < N;++ i) if (X == sc.nextInt()) find |= 1;
            for (int i = 0;i < M;++ i) if (X == sc.nextInt()) find |= 2;
            switch(find) {
                case 0:
                    System.out.println(-1);
                    break;
                case 1:
                    System.out.println("MrMax");
                    break;
                case 2:
                    System.out.println("MaxValu");
                    break;
                case 3:
                    System.out.println("MrMaxValu");
            }
        }
    }
}
0