結果
問題 | No.231 めぐるはめぐる (1) |
ユーザー | bigbear90560 |
提出日時 | 2015-07-23 00:54:12 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 188 ms / 1,000 ms |
コード長 | 1,119 bytes |
コンパイル時間 | 3,081 ms |
コンパイル使用メモリ | 74,556 KB |
実行使用メモリ | 43,220 KB |
最終ジャッジ日時 | 2024-04-25 12:17:01 |
合計ジャッジ時間 | 5,950 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 178 ms
43,220 KB |
testcase_01 | AC | 156 ms
41,708 KB |
testcase_02 | AC | 136 ms
41,348 KB |
testcase_03 | AC | 178 ms
42,516 KB |
testcase_04 | AC | 172 ms
42,812 KB |
testcase_05 | AC | 172 ms
42,240 KB |
testcase_06 | AC | 177 ms
42,884 KB |
testcase_07 | AC | 159 ms
41,800 KB |
testcase_08 | AC | 155 ms
42,296 KB |
testcase_09 | AC | 118 ms
41,396 KB |
testcase_10 | AC | 120 ms
41,416 KB |
testcase_11 | AC | 109 ms
40,960 KB |
testcase_12 | AC | 188 ms
42,516 KB |
ソースコード
import java.util.Scanner; /** * No.231 めぐるはめぐる (1) */ public class AroundAndAround { public static void main(String[] args) { final int DEATH_PENA = 30000; final int FINISH_EXP = DEATH_PENA * 100; final int MAX_PLAY_TIME = 6; // 標準入力から読み込む際に、Scannerオブジェクトを使う。 Scanner sc = new Scanner(System.in); int a = sc.nextInt(); // ダンジョン数 int b = 0; // 1時間あたりの経験値 int c = 0; // 1時間あたりの死亡数 int exp = 0; int dnum = 0; boolean result = false; for (int i=0;i<a;i++) { b = sc.nextInt(); c = sc.nextInt(); // 6時間あたりの取得経験値 exp = (b - DEATH_PENA * c) * MAX_PLAY_TIME; if (FINISH_EXP <= exp) { result = true; dnum = i + 1; } } if (result) { System.out.println("YES"); for (int i=0; i<MAX_PLAY_TIME;i++) { System.out.println(dnum); } } else { System.out.println("NO"); } } }