結果

問題 No.231 めぐるはめぐる (1)
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-04-30 17:51:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 77 ms / 1,000 ms
コード長 1,109 bytes
コンパイル時間 1,973 ms
コンパイル使用メモリ 73,252 KB
実行使用メモリ 51,216 KB
最終ジャッジ日時 2023-10-11 23:51:17
合計ジャッジ時間 3,714 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
51,216 KB
testcase_01 AC 48 ms
49,280 KB
testcase_02 AC 47 ms
49,436 KB
testcase_03 AC 61 ms
50,376 KB
testcase_04 AC 77 ms
51,092 KB
testcase_05 AC 57 ms
49,344 KB
testcase_06 AC 59 ms
50,108 KB
testcase_07 AC 47 ms
49,348 KB
testcase_08 AC 54 ms
49,476 KB
testcase_09 AC 43 ms
49,140 KB
testcase_10 AC 44 ms
49,580 KB
testcase_11 AC 44 ms
49,252 KB
testcase_12 AC 60 ms
50,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import static java.lang.System.in;


public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        int N = Integer.parseInt(reader.readLine());
        long REQUIRED_XP = 3000000;
        String[] inputs;
        long[] xps = new long[N];
        for (int i = 0; i < N; i++) {
            inputs = reader.readLine().split(" ");
            long xp = Long.parseLong(inputs[0]);
            int death = Integer.parseInt(inputs[1]);
            xps[i] = 6*(xp  - 30000 * death);
        }
        int dangeon = -1;
        for (int i = 0; i < N; i++) {
            if(REQUIRED_XP <= xps[i]) {
                dangeon = i;
//                break;
            }
        }
        if(dangeon!=-1){
            System.out.println("YES");
            for (int i = 0; i < 6; i++) {
                System.out.println(dangeon+1);
            }
        } else {
            System.out.println("NO");
        }
    }
}
0