結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
57,700 KB
testcase_01 AC 146 ms
57,616 KB
testcase_02 AC 152 ms
57,660 KB
testcase_03 WA -
testcase_04 AC 154 ms
57,696 KB
testcase_05 AC 199 ms
57,688 KB
testcase_06 AC 202 ms
57,764 KB
testcase_07 AC 213 ms
59,812 KB
testcase_08 AC 477 ms
61,996 KB
testcase_09 AC 137 ms
57,408 KB
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

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("MrMaxValue");
        }
    }
}
0