結果

問題 No.231 めぐるはめぐる (1)
ユーザー yuki2006yuki2006
提出日時 2015-06-26 02:55:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 198 ms / 1,000 ms
コード長 800 bytes
コンパイル時間 3,674 ms
コンパイル使用メモリ 75,368 KB
実行使用メモリ 43,172 KB
最終ジャッジ日時 2024-04-25 12:05:17
合計ジャッジ時間 7,087 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 196 ms
43,068 KB
testcase_01 AC 155 ms
41,656 KB
testcase_02 AC 148 ms
41,600 KB
testcase_03 AC 191 ms
42,584 KB
testcase_04 AC 198 ms
43,172 KB
testcase_05 AC 181 ms
42,368 KB
testcase_06 AC 193 ms
42,728 KB
testcase_07 AC 160 ms
41,780 KB
testcase_08 AC 180 ms
42,424 KB
testcase_09 AC 128 ms
41,388 KB
testcase_10 AC 124 ms
41,560 KB
testcase_11 AC 128 ms
41,264 KB
testcase_12 AC 193 ms
42,296 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