結果

問題 No.129 お年玉(2)
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-20 21:52:32
言語 Java21
(openjdk 21)
結果
MLE  
実行時間 -
コード長 843 bytes
コンパイル時間 3,582 ms
コンパイル使用メモリ 79,112 KB
実行使用メモリ 748,564 KB
最終ジャッジ日時 2023-09-18 01:55:56
合計ジャッジ時間 33,484 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 200 ms
92,672 KB
testcase_01 MLE -
testcase_02 AC 131 ms
53,764 KB
testcase_03 AC 129 ms
55,776 KB
testcase_04 AC 130 ms
55,516 KB
testcase_05 AC 624 ms
453,688 KB
testcase_06 MLE -
testcase_07 MLE -
testcase_08 AC 698 ms
480,832 KB
testcase_09 MLE -
testcase_10 MLE -
testcase_11 AC 678 ms
461,452 KB
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 AC 707 ms
496,368 KB
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 AC 695 ms
485,036 KB
testcase_23 MLE -
testcase_24 MLE -
testcase_25 AC 688 ms
466,640 KB
testcase_26 AC 692 ms
474,940 KB
testcase_27 AC 681 ms
463,476 KB
testcase_28 MLE -
testcase_29 AC 128 ms
55,696 KB
testcase_30 AC 127 ms
55,236 KB
testcase_31 AC 129 ms
55,500 KB
testcase_32 AC 130 ms
55,868 KB
testcase_33 AC 127 ms
55,584 KB
testcase_34 AC 140 ms
57,820 KB
testcase_35 AC 146 ms
60,168 KB
testcase_36 AC 145 ms
57,920 KB
testcase_37 AC 146 ms
59,980 KB
testcase_38 AC 266 ms
139,052 KB
testcase_39 AC 317 ms
191,484 KB
testcase_40 AC 666 ms
455,536 KB
testcase_41 AC 478 ms
359,596 KB
testcase_42 AC 275 ms
148,624 KB
testcase_43 AC 267 ms
147,204 KB
testcase_44 MLE -
testcase_45 AC 220 ms
115,120 KB
testcase_46 AC 380 ms
232,620 KB
testcase_47 MLE -
testcase_48 AC 723 ms
504,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        long n = koko.nextLong();
        int m = koko.nextInt();
        long nama = n%1000;
        long nmai = (n-nama)/1000;
        long amari = nmai%m;
        if(amari==0){
            System.out.println(1);
        }else{
            long[][] judge = new long[m+1][m+1];
            for(int i=0; i<m+1; i++){
                judge[0][i]=1;
                judge[i][0]=1;
            }
            for(int i=1; i<m+1; i++){
                for(int j=1; j<m+1; j++){
                    judge[i][j]= (judge[i-1][j]+judge[i][j-1])%1000000000;
                }
            }
            long ans = judge[(int)(m-amari)][(int)amari];
            System.out.println(ans);
        }
    }
}
0