結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 192 ms
58,256 KB
testcase_01 AC 152 ms
56,052 KB
testcase_02 AC 140 ms
56,192 KB
testcase_03 WA -
testcase_04 AC 201 ms
58,272 KB
testcase_05 AC 180 ms
56,124 KB
testcase_06 WA -
testcase_07 AC 153 ms
55,744 KB
testcase_08 AC 172 ms
56,108 KB
testcase_09 AC 120 ms
55,688 KB
testcase_10 WA -
testcase_11 AC 121 ms
55,600 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 kaisu = 3000000 / arrayG[i];
				if(3000000 % arrayG[i] != 0){
					kaisu++;
				}
				for(int j = 0; j < kaisu; j++){
					System.out.println(i + 1);	
				}
				break;
			}
		}
	}
}
0