結果
問題 |
No.975 ミスターマックスバリュ
|
ユーザー |
![]() |
提出日時 | 2020-01-31 21:25:16 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 854 bytes |
コンパイル時間 | 1,870 ms |
コンパイル使用メモリ | 76,468 KB |
実行使用メモリ | 54,208 KB |
最終ジャッジ日時 | 2024-09-17 07:05:57 |
合計ジャッジ時間 | 4,112 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 8 RE * 1 |
ソースコード
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 < n; 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); } } }