結果

問題 No.129 お年玉(2)
ユーザー rogi52rogi52
提出日時 2022-08-16 00:27:34
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 506 bytes
コンパイル時間 2,068 ms
コンパイル使用メモリ 195,512 KB
実行使用メモリ 779,676 KB
最終ジャッジ日時 2024-04-10 10:46:57
合計ジャッジ時間 10,904 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
177,656 KB
testcase_01 MLE -
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 168 ms
353,572 KB
testcase_06 AC 267 ms
453,496 KB
testcase_07 MLE -
testcase_08 MLE -
testcase_09 MLE -
testcase_10 MLE -
testcase_11 MLE -
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 MLE -
testcase_23 MLE -
testcase_24 MLE -
testcase_25 MLE -
testcase_26 MLE -
testcase_27 MLE -
testcase_28 MLE -
testcase_29 AC 2 ms
6,940 KB
testcase_30 AC 2 ms
6,944 KB
testcase_31 AC 3 ms
6,944 KB
testcase_32 AC 3 ms
7,800 KB
testcase_33 AC 15 ms
63,104 KB
testcase_34 AC 8 ms
36,272 KB
testcase_35 AC 13 ms
58,884 KB
testcase_36 AC 15 ms
63,120 KB
testcase_37 AC 16 ms
73,232 KB
testcase_38 AC 62 ms
257,540 KB
testcase_39 AC 79 ms
321,068 KB
testcase_40 MLE -
testcase_41 AC 108 ms
425,440 KB
testcase_42 AC 66 ms
275,836 KB
testcase_43 AC 65 ms
274,080 KB
testcase_44 MLE -
testcase_45 AC 47 ms
204,260 KB
testcase_46 AC 83 ms
339,644 KB
testcase_47 MLE -
testcase_48 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ll C[10001][10001];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    
    ll N,M; cin >> N >> M;
    N = N / 1000;
    N %= M;
    ll MOD = 1e9;
    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