結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー nCk_cvnCk_cv
提出日時 2015-08-01 17:22:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 1,970 ms
コンパイル使用メモリ 72,632 KB
実行使用メモリ 72,456 KB
平均クエリ数 3.70
最終ジャッジ日時 2023-09-23 21:16:54
合計ジャッジ時間 8,747 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 168 ms
72,456 KB
testcase_01 AC 166 ms
71,596 KB
testcase_02 AC 166 ms
71,860 KB
testcase_03 AC 167 ms
72,120 KB
testcase_04 AC 166 ms
69,952 KB
testcase_05 AC 163 ms
72,008 KB
testcase_06 AC 163 ms
72,080 KB
testcase_07 AC 163 ms
71,856 KB
testcase_08 AC 161 ms
72,160 KB
testcase_09 AC 162 ms
71,884 KB
testcase_10 AC 160 ms
71,912 KB
testcase_11 AC 163 ms
71,944 KB
testcase_12 AC 162 ms
71,372 KB
testcase_13 AC 165 ms
71,816 KB
testcase_14 AC 161 ms
71,660 KB
testcase_15 AC 158 ms
71,400 KB
testcase_16 AC 162 ms
72,148 KB
testcase_17 AC 163 ms
71,980 KB
testcase_18 AC 158 ms
72,044 KB
testcase_19 AC 155 ms
71,580 KB
testcase_20 AC 163 ms
72,124 KB
testcase_21 AC 167 ms
70,076 KB
testcase_22 AC 159 ms
71,940 KB
testcase_23 AC 167 ms
71,792 KB
testcase_24 AC 162 ms
72,100 KB
testcase_25 AC 165 ms
71,852 KB
testcase_26 AC 165 ms
71,496 KB
testcase_27 AC 161 ms
70,296 KB
testcase_28 AC 163 ms
69,768 KB
testcase_29 AC 168 ms
72,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<Integer>();
        for(int i = n-1; i >= 0; i -= k+1) {
            list.add(i);
        }
        Collections.reverse(list);
        for(int i = 0; i <= list.size(); i++) {
            System.out.println(list.get(i));
            if(sc.nextInt() >= n) break;
        }
    }
}
0