結果

問題 No.129 お年玉(2)
ユーザー Ai3ShotaAi3Shota
提出日時 2018-05-09 23:43:51
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 471 bytes
コンパイル時間 1,187 ms
コンパイル使用メモリ 143,656 KB
実行使用メモリ 233,284 KB
最終ジャッジ日時 2023-09-10 11:30:53
合計ジャッジ時間 21,507 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 47 ms
43,912 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 WA -
testcase_06 AC 733 ms
159,632 KB
testcase_07 AC 782 ms
183,144 KB
testcase_08 AC 172 ms
69,692 KB
testcase_09 WA -
testcase_10 AC 680 ms
175,472 KB
testcase_11 WA -
testcase_12 AC 211 ms
61,940 KB
testcase_13 AC 163 ms
54,916 KB
testcase_14 AC 782 ms
166,612 KB
testcase_15 AC 611 ms
141,008 KB
testcase_16 AC 690 ms
160,840 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 407 ms
108,380 KB
testcase_20 AC 842 ms
190,104 KB
testcase_21 AC 1,048 ms
193,492 KB
testcase_22 WA -
testcase_23 AC 759 ms
188,136 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 374 ms
109,848 KB
testcase_27 AC 401 ms
113,400 KB
testcase_28 WA -
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 1 ms
4,376 KB
testcase_34 AC 5 ms
5,388 KB
testcase_35 WA -
testcase_36 AC 9 ms
7,468 KB
testcase_37 AC 9 ms
7,736 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 287 ms
79,512 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 456 ms
137,484 KB
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define MOD 1000000000

using namespace std;

long long N, M;
long long dp[10001][10001] = {{0}};

long long rec(long long n, long long r)
{
    if (r == 0 || r == n) return 1;
    else if (r == 1) return n % MOD;
    if(dp[n][r] != 0) return dp[n][r] % MOD;
    return dp[n][r] = (rec(n - 1, r - 1) % MOD + rec(n - 1, r) % MOD);
}

int main(void){
    
    cin >> N >> M;
    cout << rec(M, (N % (M * 1000)) / 1000) << endl;
    
    return 0;
}
0