結果

問題 No.231 めぐるはめぐる (1)
ユーザー yagi2yagi2
提出日時 2017-04-21 11:05:39
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 894 bytes
コンパイル時間 2,412 ms
コンパイル使用メモリ 87,576 KB
実行使用メモリ 59,328 KB
最終ジャッジ日時 2023-09-27 10:50:22
合計ジャッジ時間 7,255 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 203 ms
58,900 KB
testcase_04 AC 211 ms
59,132 KB
testcase_05 WA -
testcase_06 AC 212 ms
59,328 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 129 ms
55,648 KB
testcase_10 AC 132 ms
55,852 KB
testcase_11 AC 129 ms
55,940 KB
testcase_12 AC 204 ms
56,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int D = Integer.parseInt(sc.next());

        Map<Integer, Long> exp = new HashMap<>();

        for (int i = 0; i < D; i++) {
            exp.put(i+1, sc.nextLong() - (sc.nextInt()*3000));
        }

        List<Map.Entry<Integer, Long>> entries = new ArrayList<>(exp.entrySet());
        entries.sort((o1, o2) -> {
            if (o1.getValue() > o2.getValue()) return -1;
            if (o1.getValue() < o2.getValue()) return 1;
            return 0;
        });


        if (entries.get(0).getValue() * 6 >= 3000000) {
            System.out.println("YES");
            for (int i = 0; i < 6; i++) {
                System.out.println(entries.get(0).getKey());
            }
        } else {
            System.out.println("NO");
        }
    }
}
0