結果

問題 No.975 ミスターマックスバリュ
ユーザー C_nena_EC_nena_E
提出日時 2020-01-31 21:26:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 450 ms / 2,000 ms
コード長 854 bytes
コンパイル時間 2,369 ms
コンパイル使用メモリ 76,528 KB
実行使用メモリ 61,404 KB
最終ジャッジ日時 2023-10-17 08:39:11
合計ジャッジ時間 5,167 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
57,448 KB
testcase_01 AC 138 ms
57,604 KB
testcase_02 AC 141 ms
57,656 KB
testcase_03 AC 147 ms
57,588 KB
testcase_04 AC 148 ms
57,556 KB
testcase_05 AC 192 ms
57,664 KB
testcase_06 AC 196 ms
57,664 KB
testcase_07 AC 203 ms
57,884 KB
testcase_08 AC 450 ms
61,404 KB
testcase_09 AC 136 ms
57,588 KB
testcase_10 AC 136 ms
57,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int n = sc.nextInt();
        int m = sc.nextInt();
        String ans = "";
        for(int i = 0; i < n; i++){
            if(x == sc.nextInt()){
                ans += "MrMax";
                break;
            }
        }
        for(int i = 0; i < m; i++){
            if(x == sc.nextInt()){
                if(!ans.isEmpty()){
                    ans += "Valu";
                }else{
                    ans += "MaxValu";
                }
                break;
            }
        }
        if(!ans.isEmpty()){
            System.out.println(ans);
        }else{
            System.out.println(-1);
        }
    }
}

0