結果

問題 No.231 めぐるはめぐる (1)
ユーザー yuki2006yuki2006
提出日時 2015-06-26 02:55:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 193 ms / 1,000 ms
コード長 800 bytes
コンパイル時間 3,474 ms
コンパイル使用メモリ 72,108 KB
実行使用メモリ 58,276 KB
最終ジャッジ日時 2023-08-07 18:33:11
合計ジャッジ時間 6,552 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 191 ms
58,188 KB
testcase_01 AC 155 ms
55,940 KB
testcase_02 AC 139 ms
55,776 KB
testcase_03 AC 188 ms
58,200 KB
testcase_04 AC 193 ms
58,120 KB
testcase_05 AC 174 ms
55,848 KB
testcase_06 AC 187 ms
58,276 KB
testcase_07 AC 153 ms
56,208 KB
testcase_08 AC 183 ms
56,088 KB
testcase_09 AC 124 ms
55,804 KB
testcase_10 AC 124 ms
56,128 KB
testcase_11 AC 123 ms
56,172 KB
testcase_12 AC 185 ms
56,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder231 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int[] gain = new int[N];
        int maxIndex = 0;
        int max = 0;
        for (int i = 0; i < N; i++) {
            int G = scanner.nextInt();
            int D = scanner.nextInt();
            gain[i] = G - 30000 * D;
            if (max < gain[i]) {
                max = gain[i];
                maxIndex = i;
            }
        }
        if (3000000 > gain[maxIndex] * 6) {
            System.out.println("NO");
        } else {
            System.out.println("YES");
            for (int i = 0; i < 6; i++) {
                System.out.println(maxIndex + 1);
            }
        }


    }
}
0