結果

問題 No.231 めぐるはめぐる (1)
ユーザー bigbear90560bigbear90560
提出日時 2015-07-22 22:13:13
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,289 bytes
コンパイル時間 3,845 ms
コンパイル使用メモリ 74,648 KB
実行使用メモリ 60,768 KB
最終ジャッジ日時 2023-09-22 21:24:46
合計ジャッジ時間 7,940 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 140 ms
56,148 KB
testcase_02 AC 135 ms
56,276 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 165 ms
56,220 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 119 ms
56,236 KB
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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;
		final String SEP = System.lineSeparator();
		
		StringBuilder sb = new StringBuilder();
		
		// 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();	// ダンジョン数
        int[] b = new int[a];	// 1時間あたりの経験値
        int[] c = new int[a];	// 1時間あたりの死亡数

    	int exp = 0;
    	int dnum = 0;
    	boolean result = false;
    	
    	
        for (int i=0;i<a;i++) {
        	b[i] = sc.nextInt();
        	c[i] = sc.nextInt();
        	// 6時間あたりの取得経験値
        	exp = (b[i] - DEATH_PENA * c[i]) * MAX_PLAY_TIME;

        	if (FINISH_EXP <= exp) {
        		result = true;
        		dnum = i + 1;
        	}
        }

        if (result) {
        	sb.append("YES").append(SEP);
        	for (int i=0; i<MAX_PLAY_TIME;i++) {
            	sb.append(dnum).append(SEP);
        	}
        } else {
        	sb.append("NO");
        }
    	System.out.println(sb.toString());
	}

}
0