結果

問題 No.231 めぐるはめぐる (1)
ユーザー matsuyoshi30matsuyoshi30
提出日時 2017-02-01 22:54:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 191 ms / 1,000 ms
コード長 829 bytes
コンパイル時間 3,971 ms
コンパイル使用メモリ 72,564 KB
実行使用メモリ 58,876 KB
最終ジャッジ日時 2023-08-25 17:05:47
合計ジャッジ時間 7,386 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 191 ms
58,876 KB
testcase_01 AC 157 ms
55,776 KB
testcase_02 AC 138 ms
55,700 KB
testcase_03 AC 183 ms
58,252 KB
testcase_04 AC 186 ms
58,656 KB
testcase_05 AC 179 ms
55,984 KB
testcase_06 AC 184 ms
58,636 KB
testcase_07 AC 151 ms
56,012 KB
testcase_08 AC 170 ms
56,588 KB
testcase_09 AC 120 ms
55,724 KB
testcase_10 AC 122 ms
55,964 KB
testcase_11 AC 120 ms
56,064 KB
testcase_12 AC 182 ms
56,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] g = new int[n];
        int[] d = new int[n];
        int max = 0;
        int stageNum = 0;
        for(int i=0; i<n; i++) {
            g[i] = in.nextInt();
            d[i] = in.nextInt();
            max = Math.max(max, g[i] - d[i] * 30000);
            if(max == g[i] - d[i] * 30000) stageNum = i + 1;
        }

        int u = 30000 * 100;

        if(max * 6 >= u) {
            System.out.println("YES");
            for(int i=0; i<6; i++) System.out.println(stageNum);
        } else {
            System.out.println("NO");
        }

        in.close();
    }
}
0