結果

問題 No.231 めぐるはめぐる (1)
ユーザー 練習生練習生
提出日時 2015-08-07 15:22:04
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 777 bytes
コンパイル時間 3,610 ms
コンパイル使用メモリ 73,196 KB
実行使用メモリ 58,460 KB
最終ジャッジ日時 2023-09-25 05:48:01
合計ジャッジ時間 7,593 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 192 ms
58,284 KB
testcase_01 AC 159 ms
56,248 KB
testcase_02 AC 142 ms
55,580 KB
testcase_03 WA -
testcase_04 AC 193 ms
58,460 KB
testcase_05 AC 169 ms
56,192 KB
testcase_06 WA -
testcase_07 AC 160 ms
56,132 KB
testcase_08 AC 184 ms
55,988 KB
testcase_09 AC 124 ms
55,816 KB
testcase_10 WA -
testcase_11 AC 126 ms
55,928 KB
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No231 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		boolean cleable = false;
		int[] arrayG = new int[n];
		//データ入力
		for(int i = 0; i < n; i++){
			int g = sc.nextInt();
			int d = sc.nextInt();
			//クリア可能かどうか判定
			if((g - 30000 * d) >= 500000){
				cleable = true;
				arrayG[i] = g - 30000 * d;
			}
		}
		sc.close();
		//判定
		if(!cleable){
			System.out.println("NO");
		}else{
			System.out.println("YES");			
			for(int i = 0; i < n; i ++){
				if(arrayG[i] < 500000){
					continue;
				}
				int keikenti = 0;
				while(keikenti < 3000000){
					keikenti += arrayG[i];
					System.out.println(i + 1);
				}
				break;
			}
		}
	}
}
0