結果

問題 No.129 お年玉(2)
ユーザー yuki2006yuki2006
提出日時 2015-01-16 17:41:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 286 ms / 5,000 ms
コード長 670 bytes
コンパイル時間 3,422 ms
コンパイル使用メモリ 73,812 KB
実行使用メモリ 41,600 KB
最終ジャッジ日時 2024-05-05 21:29:11
合計ジャッジ時間 13,246 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
40,044 KB
testcase_01 AC 277 ms
40,456 KB
testcase_02 AC 113 ms
40,552 KB
testcase_03 AC 119 ms
41,048 KB
testcase_04 AC 119 ms
41,204 KB
testcase_05 AC 185 ms
41,352 KB
testcase_06 AC 220 ms
41,200 KB
testcase_07 AC 245 ms
41,324 KB
testcase_08 AC 205 ms
41,044 KB
testcase_09 AC 236 ms
41,148 KB
testcase_10 AC 266 ms
41,180 KB
testcase_11 AC 207 ms
41,328 KB
testcase_12 AC 234 ms
40,176 KB
testcase_13 AC 241 ms
39,960 KB
testcase_14 AC 238 ms
41,204 KB
testcase_15 AC 201 ms
40,212 KB
testcase_16 AC 212 ms
39,896 KB
testcase_17 AC 238 ms
40,300 KB
testcase_18 AC 231 ms
40,352 KB
testcase_19 AC 252 ms
41,124 KB
testcase_20 AC 244 ms
40,304 KB
testcase_21 AC 267 ms
40,344 KB
testcase_22 AC 203 ms
40,060 KB
testcase_23 AC 251 ms
40,484 KB
testcase_24 AC 257 ms
41,460 KB
testcase_25 AC 193 ms
40,252 KB
testcase_26 AC 210 ms
41,600 KB
testcase_27 AC 194 ms
40,336 KB
testcase_28 AC 286 ms
41,196 KB
testcase_29 AC 107 ms
41,252 KB
testcase_30 AC 99 ms
40,048 KB
testcase_31 AC 104 ms
40,300 KB
testcase_32 AC 106 ms
39,892 KB
testcase_33 AC 114 ms
41,080 KB
testcase_34 AC 108 ms
41,200 KB
testcase_35 AC 114 ms
41,048 KB
testcase_36 AC 106 ms
40,400 KB
testcase_37 AC 116 ms
41,332 KB
testcase_38 AC 132 ms
41,296 KB
testcase_39 AC 141 ms
41,284 KB
testcase_40 AC 194 ms
41,176 KB
testcase_41 AC 146 ms
40,152 KB
testcase_42 AC 132 ms
41,068 KB
testcase_43 AC 128 ms
40,472 KB
testcase_44 AC 269 ms
40,280 KB
testcase_45 AC 114 ms
40,136 KB
testcase_46 AC 146 ms
41,312 KB
testcase_47 AC 281 ms
41,108 KB
testcase_48 AC 199 ms
40,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yuki129 {


    public Yuki129() {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        int M = scanner.nextInt();
        int MOD = 1000000000;

        long A = (N / 1000) / M;
        int K = (int) (N / 1000 - A * M);

        int[] dp = new int[M + 1];
        dp[0] = 1;
        dp[1] = 1;

        for (int i = 2; i <= M; i++) {
            for (int j = i; j >= 1; j--) {
                dp[j] = (dp[j] + dp[j - 1]) % MOD;
            }
        }
        System.out.println(dp[K]);

    }

    public static void main(String[] args) {
        Yuki129 hoge = new Yuki129();
    }
}

0