結果

問題 No.231 めぐるはめぐる (1)
ユーザー yukicoderyukicoder
提出日時 2015-08-07 15:53:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 203 ms / 1,000 ms
コード長 1,037 bytes
コンパイル時間 3,494 ms
コンパイル使用メモリ 74,328 KB
実行使用メモリ 43,544 KB
最終ジャッジ日時 2024-04-25 12:17:28
合計ジャッジ時間 6,627 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 203 ms
43,544 KB
testcase_01 AC 160 ms
41,648 KB
testcase_02 AC 141 ms
41,576 KB
testcase_03 AC 194 ms
42,520 KB
testcase_04 AC 201 ms
43,224 KB
testcase_05 AC 194 ms
42,344 KB
testcase_06 AC 200 ms
42,968 KB
testcase_07 AC 170 ms
41,652 KB
testcase_08 AC 184 ms
42,216 KB
testcase_09 AC 134 ms
41,356 KB
testcase_10 AC 130 ms
41,328 KB
testcase_11 AC 134 ms
41,476 KB
testcase_12 AC 188 ms
42,700 KB
権限があれば一括ダウンロードができます

ソースコード

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 = 6;
                for(int j = 0; j < kaisu; j++){
                    System.out.println(i + 1);	
                }
                break;
            }
        }
    }
}
0