結果

問題 No.231 めぐるはめぐる (1)
ユーザー mobius_bkstmobius_bkst
提出日時 2015-06-26 23:06:52
言語 Java19
(openjdk 21)
結果
AC  
実行時間 69 ms / 1,000 ms
コード長 1,399 bytes
コンパイル時間 3,387 ms
コンパイル使用メモリ 74,668 KB
実行使用メモリ 51,420 KB
最終ジャッジ日時 2023-08-07 18:37:08
合計ジャッジ時間 4,796 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
51,420 KB
testcase_01 AC 48 ms
49,060 KB
testcase_02 AC 45 ms
49,064 KB
testcase_03 AC 59 ms
50,384 KB
testcase_04 AC 64 ms
50,392 KB
testcase_05 AC 55 ms
48,956 KB
testcase_06 AC 58 ms
50,264 KB
testcase_07 AC 49 ms
49,320 KB
testcase_08 AC 53 ms
49,772 KB
testcase_09 AC 43 ms
49,292 KB
testcase_10 AC 44 ms
49,488 KB
testcase_11 AC 43 ms
49,048 KB
testcase_12 AC 60 ms
51,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class No231 {
    private static final int LEVELUP = 30000 * 100;

    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(
                    System.in));
            int N = Integer.parseInt(br.readLine());
            int max = 0;
            int key = -1;
            for (int i = 0; i < N; i++) {
                int[] a = strToIntArray(br.readLine());
                int value = a[0] - 30000 * a[1];
                max = Math.max(max, value);
                if (max == value) {
                    key = i + 1;
                }
            }

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

        } catch (Exception e) {
            e.printStackTrace();
            System.err.println("Error:" + e.getMessage());
        }
    }

    static int[] strToIntArray(String S) {
        String[] strArray = S.split(" ");
        int[] intArray = new int[strArray.length];
        for (int i = 0; i < strArray.length; i++) {
            intArray[i] = Integer.parseInt(strArray[i]);
        }
        return intArray;
    }
}
0