結果

問題 No.129 お年玉(2)
ユーザー tentententen
提出日時 2020-12-04 16:58:05
言語 Java19
(openjdk 21)
結果
MLE  
実行時間 -
コード長 648 bytes
コンパイル時間 2,316 ms
コンパイル使用メモリ 72,376 KB
実行使用メモリ 748,824 KB
最終ジャッジ日時 2023-10-13 06:16:57
合計ジャッジ時間 28,148 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 173 ms
91,596 KB
testcase_01 MLE -
testcase_02 AC 176 ms
54,252 KB
testcase_03 AC 117 ms
55,996 KB
testcase_04 AC 115 ms
55,848 KB
testcase_05 AC 493 ms
454,312 KB
testcase_06 MLE -
testcase_07 MLE -
testcase_08 AC 552 ms
481,096 KB
testcase_09 MLE -
testcase_10 MLE -
testcase_11 AC 545 ms
461,424 KB
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 AC 558 ms
497,104 KB
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 AC 548 ms
485,176 KB
testcase_23 MLE -
testcase_24 MLE -
testcase_25 AC 523 ms
466,468 KB
testcase_26 AC 526 ms
475,340 KB
testcase_27 AC 529 ms
461,880 KB
testcase_28 MLE -
testcase_29 AC 111 ms
56,480 KB
testcase_30 AC 115 ms
56,336 KB
testcase_31 AC 117 ms
56,248 KB
testcase_32 AC 113 ms
56,380 KB
testcase_33 AC 121 ms
60,692 KB
testcase_34 AC 117 ms
57,932 KB
testcase_35 AC 126 ms
60,868 KB
testcase_36 AC 123 ms
60,540 KB
testcase_37 AC 129 ms
60,436 KB
testcase_38 AC 215 ms
136,876 KB
testcase_39 AC 248 ms
191,728 KB
testcase_40 AC 521 ms
455,736 KB
testcase_41 AC 369 ms
359,908 KB
testcase_42 AC 239 ms
188,984 KB
testcase_43 AC 223 ms
147,700 KB
testcase_44 MLE -
testcase_45 AC 185 ms
115,268 KB
testcase_46 AC 316 ms
232,652 KB
testcase_47 MLE -
testcase_48 AC 562 ms
504,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    static final int MOD = 1000000000;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong() / 1000;
        int m = sc.nextInt();
        long[][] comb = new long[m + 1][m + 1];
        for (int i = 0; i <= m; i++) {
            for (int j = 0; j <= i; j++) {
                if (j == 0 || j == i) {
                    comb[i][j] = 1;
                } else {
                    comb[i][j] = (comb[i - 1][j - 1] + comb[i - 1][j]) % MOD;
                }
            }
        }
        System.out.println(comb[m][(int)(n % m)]);
    }
}
0