結果

問題 No.975 ミスターマックスバリュ
ユーザー tentententen
提出日時 2020-11-09 20:33:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 384 ms / 2,000 ms
コード長 633 bytes
コンパイル時間 2,135 ms
コンパイル使用メモリ 73,372 KB
実行使用メモリ 60,604 KB
最終ジャッジ日時 2023-09-29 22:15:08
合計ジャッジ時間 4,751 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
56,256 KB
testcase_01 AC 120 ms
55,780 KB
testcase_02 AC 125 ms
56,016 KB
testcase_03 AC 124 ms
56,400 KB
testcase_04 AC 124 ms
55,776 KB
testcase_05 AC 153 ms
56,080 KB
testcase_06 AC 162 ms
56,404 KB
testcase_07 AC 185 ms
58,680 KB
testcase_08 AC 384 ms
60,604 KB
testcase_09 AC 113 ms
56,192 KB
testcase_10 AC 115 ms
55,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int n = sc.nextInt();
        int m = sc.nextInt();
        String ans = "Max";
        for (int i = 0; i < n; i++) {
            if (x == sc.nextInt()) {
                ans = "Mr" + ans;
            }
        }
        for (int i = 0; i < m; i++) {
            if (x == sc.nextInt()) {
                ans = ans + "Valu";
            }
        }
        if (ans.equals("Max")) {
            ans = "-1";
        }
        
        System.out.println(ans);
    }
}
0