結果

問題 No.975 ミスターマックスバリュ
ユーザー C_nena_E
提出日時 2020-01-31 21:26:12
言語 Java
(openjdk 23)
結果
AC  
実行時間 441 ms / 2,000 ms
コード長 854 bytes
コンパイル時間 1,895 ms
コンパイル使用メモリ 76,564 KB
実行使用メモリ 59,240 KB
最終ジャッジ日時 2024-09-17 07:07:29
合計ジャッジ時間 4,243 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

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