結果

問題 No.975 ミスターマックスバリュ
ユーザー mattyan0502mattyan0502
提出日時 2020-02-03 17:15:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 461 ms / 2,000 ms
コード長 1,134 bytes
コンパイル時間 2,268 ms
コンパイル使用メモリ 77,224 KB
実行使用メモリ 61,824 KB
最終ジャッジ日時 2023-10-19 05:42:13
合計ジャッジ時間 5,132 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
57,520 KB
testcase_01 AC 143 ms
57,608 KB
testcase_02 AC 148 ms
57,684 KB
testcase_03 AC 147 ms
57,428 KB
testcase_04 AC 152 ms
57,544 KB
testcase_05 AC 201 ms
57,756 KB
testcase_06 AC 200 ms
57,668 KB
testcase_07 AC 215 ms
59,760 KB
testcase_08 AC 461 ms
61,824 KB
testcase_09 AC 139 ms
57,672 KB
testcase_10 AC 136 ms
57,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int X = sc.nextInt();
        int N = sc.nextInt();
        int M = sc.nextInt();
        int A[] = new int[N];
        int B[] = new int[M];
        int mrflag = 0;
        int maflag = 0;
        for(int i=0;i<N;i++)
        {
            A[i] = sc.nextInt();
            if(A[i] == X)
            {
                mrflag = 1;
            }
        }
        for(int j=0;j<M;j++)
        {
            B[j] = sc.nextInt();
            if(B[j] == X)
            {
                maflag = 1;
            }
        }
        
        if(mrflag == 0 && maflag == 0)
        {
            System.out.println(-1);
        }
        else if(mrflag == 0 && maflag == 1)
        {
            System.out.println("MaxValu");
        }
        else if(mrflag == 1 && maflag == 0)
        {
            System.out.println("MrMax");
        }
        else if(mrflag == 1 && maflag == 1)
        {
            System.out.println("MrMaxValu");
        }
    }
}
0