結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 196 ms
58,400 KB
testcase_01 AC 159 ms
55,932 KB
testcase_02 AC 140 ms
55,856 KB
testcase_03 WA -
testcase_04 AC 191 ms
58,580 KB
testcase_05 AC 186 ms
56,112 KB
testcase_06 WA -
testcase_07 AC 163 ms
56,104 KB
testcase_08 AC 181 ms
56,344 KB
testcase_09 AC 125 ms
56,060 KB
testcase_10 WA -
testcase_11 AC 120 ms
55,780 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);
					if(keikenti >=3000000){
						break;
					}
				}
				break;
			}
		}
	}
}
0