結果

問題 No.975 ミスターマックスバリュ
ユーザー CuriousFairy315CuriousFairy315
提出日時 2020-01-31 21:53:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 443 ms / 2,000 ms
コード長 869 bytes
コンパイル時間 4,325 ms
コンパイル使用メモリ 74,300 KB
実行使用メモリ 60,056 KB
最終ジャッジ日時 2023-10-17 09:32:53
合計ジャッジ時間 7,189 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
57,708 KB
testcase_01 AC 135 ms
57,632 KB
testcase_02 AC 139 ms
57,612 KB
testcase_03 AC 137 ms
57,772 KB
testcase_04 AC 145 ms
57,736 KB
testcase_05 AC 184 ms
57,696 KB
testcase_06 AC 189 ms
55,620 KB
testcase_07 AC 202 ms
59,808 KB
testcase_08 AC 443 ms
60,056 KB
testcase_09 AC 131 ms
57,384 KB
testcase_10 AC 128 ms
57,728 KB
権限があれば一括ダウンロードができます

ソースコード

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