結果

問題 No.129 お年玉(2)
ユーザー htensaihtensai
提出日時 2019-12-12 18:55:11
言語 Java21
(openjdk 21)
結果
MLE  
実行時間 -
コード長 679 bytes
コンパイル時間 4,000 ms
コンパイル使用メモリ 72,520 KB
実行使用メモリ 747,200 KB
最終ジャッジ日時 2023-09-07 18:48:50
合計ジャッジ時間 30,174 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 177 ms
91,772 KB
testcase_01 MLE -
testcase_02 AC 174 ms
53,704 KB
testcase_03 AC 123 ms
55,952 KB
testcase_04 AC 127 ms
55,508 KB
testcase_05 AC 530 ms
453,760 KB
testcase_06 MLE -
testcase_07 MLE -
testcase_08 AC 570 ms
480,384 KB
testcase_09 MLE -
testcase_10 MLE -
testcase_11 AC 556 ms
461,164 KB
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 AC 577 ms
498,436 KB
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 AC 571 ms
484,364 KB
testcase_23 MLE -
testcase_24 MLE -
testcase_25 AC 562 ms
466,392 KB
testcase_26 AC 564 ms
474,924 KB
testcase_27 AC 555 ms
461,304 KB
testcase_28 MLE -
testcase_29 AC 123 ms
55,784 KB
testcase_30 AC 120 ms
55,472 KB
testcase_31 AC 124 ms
55,520 KB
testcase_32 AC 125 ms
57,764 KB
testcase_33 AC 135 ms
60,512 KB
testcase_34 AC 129 ms
57,528 KB
testcase_35 AC 135 ms
60,212 KB
testcase_36 AC 137 ms
60,476 KB
testcase_37 AC 137 ms
60,380 KB
testcase_38 AC 230 ms
138,180 KB
testcase_39 AC 267 ms
191,424 KB
testcase_40 AC 550 ms
455,180 KB
testcase_41 AC 394 ms
359,224 KB
testcase_42 AC 246 ms
188,748 KB
testcase_43 AC 233 ms
147,164 KB
testcase_44 MLE -
testcase_45 AC 189 ms
115,016 KB
testcase_46 AC 316 ms
232,236 KB
testcase_47 MLE -
testcase_48 AC 581 ms
504,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        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]) % 1000000000;
                }
            }
        }
        int count = (int)((n / 1000) % m);
        System.out.println(comb[m][count]);
    }
}
0