結果

問題 No.975 ミスターマックスバリュ
ユーザー Yosuke YamaguchiYosuke Yamaguchi
提出日時 2021-02-16 10:05:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 369 ms / 2,000 ms
コード長 1,148 bytes
コンパイル時間 3,468 ms
コンパイル使用メモリ 76,204 KB
実行使用メモリ 60,648 KB
最終ジャッジ日時 2023-10-10 21:50:16
合計ジャッジ時間 5,963 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,776 KB
testcase_01 AC 123 ms
55,904 KB
testcase_02 AC 126 ms
55,924 KB
testcase_03 AC 125 ms
55,812 KB
testcase_04 AC 126 ms
55,940 KB
testcase_05 AC 171 ms
56,396 KB
testcase_06 AC 169 ms
56,252 KB
testcase_07 AC 172 ms
55,900 KB
testcase_08 AC 369 ms
60,648 KB
testcase_09 AC 121 ms
55,716 KB
testcase_10 AC 119 ms
55,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

// https://yukicoder.me/problems/no/975
public class MrMaxValue975 {
  public static void main(String[] args) {
    // 標準入力から読み込む際に、Scan
    Scanner sc = new Scanner(System.in);
    int itemNumber = Integer.parseInt(sc.next());
    int mrMaxItemNumber = Integer.parseInt(sc.next());
    int maxValuItemNumber = Integer.parseInt(sc.next());
    List<Integer> mrMaxItemList = new ArrayList<Integer>();
    List<Integer> maxValuItemList = new ArrayList<Integer>();

    for (int i = 0; i < mrMaxItemNumber; i++) {
      mrMaxItemList.add(Integer.parseInt(sc.next()));
    }
    for (int j = 0; j < maxValuItemNumber; j++) {
      maxValuItemList.add(Integer.parseInt(sc.next()));
    }
    if (mrMaxItemList.contains(itemNumber) && maxValuItemList.contains(itemNumber)) {
      System.out.println("MrMaxValu");
    } else if (mrMaxItemList.contains(itemNumber)) {
      System.out.println("MrMax");
    } else if (maxValuItemList.contains(itemNumber)) {
      System.out.println("MaxValu");
    } else {
      System.out.println("-1");
    }
  }
}
0