結果

問題 No.129 お年玉(2)
ユーザー aaaaaaiuaaaaaaiu
提出日時 2019-08-24 02:53:12
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 222 ms / 5,000 ms
コード長 370 bytes
コンパイル時間 2,228 ms
コンパイル使用メモリ 193,976 KB
実行使用メモリ 236,800 KB
最終ジャッジ日時 2024-04-21 16:00:59
合計ジャッジ時間 8,900 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
20,096 KB
testcase_01 AC 222 ms
236,800 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 82 ms
106,496 KB
testcase_06 AC 149 ms
160,256 KB
testcase_07 AC 178 ms
192,768 KB
testcase_08 AC 124 ms
136,320 KB
testcase_09 AC 165 ms
179,072 KB
testcase_10 AC 184 ms
199,424 KB
testcase_11 AC 110 ms
131,328 KB
testcase_12 AC 155 ms
167,168 KB
testcase_13 AC 163 ms
174,080 KB
testcase_14 AC 178 ms
168,704 KB
testcase_15 AC 129 ms
141,184 KB
testcase_16 AC 147 ms
158,848 KB
testcase_17 AC 177 ms
189,440 KB
testcase_18 AC 167 ms
179,456 KB
testcase_19 AC 178 ms
190,336 KB
testcase_20 AC 176 ms
188,928 KB
testcase_21 AC 216 ms
231,808 KB
testcase_22 AC 121 ms
137,856 KB
testcase_23 AC 190 ms
204,672 KB
testcase_24 AC 184 ms
197,248 KB
testcase_25 AC 112 ms
132,096 KB
testcase_26 AC 118 ms
135,040 KB
testcase_27 AC 111 ms
131,328 KB
testcase_28 AC 219 ms
233,984 KB
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 2 ms
5,376 KB
testcase_33 AC 4 ms
5,760 KB
testcase_34 AC 3 ms
5,376 KB
testcase_35 AC 3 ms
5,376 KB
testcase_36 AC 4 ms
5,888 KB
testcase_37 AC 5 ms
6,528 KB
testcase_38 AC 25 ms
35,328 KB
testcase_39 AC 36 ms
50,048 KB
testcase_40 AC 96 ms
123,648 KB
testcase_41 AC 59 ms
79,872 KB
testcase_42 AC 26 ms
39,040 KB
testcase_43 AC 33 ms
38,656 KB
testcase_44 AC 220 ms
235,008 KB
testcase_45 AC 21 ms
24,448 KB
testcase_46 AC 40 ms
55,040 KB
testcase_47 AC 212 ms
227,712 KB
testcase_48 AC 131 ms
143,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int mod=1e9;
    ll n,m;
    cin>>n>>m;
    n/=1000;
    n%=m;
    int c[m+1][m+1];
    for (int i=0;i<=m;i++)
        c[i][0]=c[i][i]=1;
    for (int i=2;i<=m;i++)
        for (int j=1;j<i;j++)
            c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod;
    cout<<c[m][n]<<endl;
    return 0;
}
0