結果

問題 No.129 お年玉(2)
ユーザー rogi52rogi52
提出日時 2022-08-16 00:26:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 537 bytes
コンパイル時間 2,915 ms
コンパイル使用メモリ 200,056 KB
実行使用メモリ 784,896 KB
最終ジャッジ日時 2024-04-10 10:46:03
合計ジャッジ時間 19,187 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
41,856 KB
testcase_01 MLE -
testcase_02 AC 3 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 272 ms
321,536 KB
testcase_06 AC 426 ms
510,080 KB
testcase_07 MLE -
testcase_08 AC 357 ms
425,728 KB
testcase_09 MLE -
testcase_10 MLE -
testcase_11 AC 341 ms
407,936 KB
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 AC 370 ms
443,520 KB
testcase_16 AC 416 ms
504,704 KB
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 AC 364 ms
430,336 KB
testcase_23 MLE -
testcase_24 MLE -
testcase_25 AC 345 ms
410,752 KB
testcase_26 AC 362 ms
420,864 KB
testcase_27 AC 346 ms
408,064 KB
testcase_28 MLE -
testcase_29 AC 2 ms
6,940 KB
testcase_30 AC 2 ms
6,944 KB
testcase_31 AC 2 ms
6,940 KB
testcase_32 AC 2 ms
6,940 KB
testcase_33 AC 6 ms
7,936 KB
testcase_34 AC 4 ms
6,944 KB
testcase_35 AC 5 ms
7,168 KB
testcase_36 AC 5 ms
7,936 KB
testcase_37 AC 7 ms
9,344 KB
testcase_38 AC 73 ms
86,272 KB
testcase_39 AC 109 ms
132,480 KB
testcase_40 AC 329 ms
380,928 KB
testcase_41 AC 197 ms
230,784 KB
testcase_42 AC 88 ms
98,304 KB
testcase_43 AC 83 ms
96,512 KB
testcase_44 MLE -
testcase_45 AC 52 ms
54,272 KB
testcase_46 AC 152 ms
148,608 KB
testcase_47 MLE -
testcase_48 AC 365 ms
449,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    
    ll N,M; cin >> N >> M;
    N = N / 1000;
    N %= M;
    ll MOD = 1e9;
    vector<vector<ll>> C(M + 1, vector<ll>(M + 1));
    for(int i = 0; i <= M; i++) C[i][0] = C[i][i] = 1;
    for(int i = 1; i <= M; i++) {
        for(int k = 1; k < i; k++) {
            C[i][k] = (C[i - 1][k - 1] + C[i - 1][k]) % MOD;
        }
    }
    cout << C[M][N] << endl;
}
0