結果

問題 No.975 ミスターマックスバリュ
ユーザー tenten
提出日時 2020-11-09 20:33:12
言語 Java
(openjdk 23)
結果
AC  
実行時間 519 ms / 2,000 ms
コード長 633 bytes
コンパイル時間 2,559 ms
コンパイル使用メモリ 76,528 KB
実行使用メモリ 48,240 KB
最終ジャッジ日時 2024-07-22 16:17:56
合計ジャッジ時間 5,268 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

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