結果

問題 No.129 お年玉(2)
ユーザー dnishdnish
提出日時 2018-06-22 17:30:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 654 bytes
コンパイル時間 1,898 ms
コンパイル使用メモリ 164,356 KB
実行使用メモリ 791,748 KB
最終ジャッジ日時 2023-09-13 08:02:08
合計ジャッジ時間 19,260 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,744 KB
testcase_01 MLE -
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 410 ms
295,716 KB
testcase_06 AC 348 ms
251,480 KB
testcase_07 AC 600 ms
435,200 KB
testcase_08 AC 597 ms
413,968 KB
testcase_09 AC 319 ms
228,320 KB
testcase_10 AC 681 ms
490,852 KB
testcase_11 AC 359 ms
259,596 KB
testcase_12 AC 73 ms
62,868 KB
testcase_13 AC 64 ms
55,244 KB
testcase_14 AC 355 ms
256,224 KB
testcase_15 AC 302 ms
219,940 KB
testcase_16 AC 409 ms
296,644 KB
testcase_17 AC 277 ms
203,800 KB
testcase_18 AC 599 ms
432,528 KB
testcase_19 MLE -
testcase_20 AC 517 ms
366,652 KB
testcase_21 AC 339 ms
248,948 KB
testcase_22 AC 414 ms
300,592 KB
testcase_23 AC 671 ms
484,184 KB
testcase_24 MLE -
testcase_25 AC 343 ms
246,668 KB
testcase_26 AC 485 ms
347,812 KB
testcase_27 AC 451 ms
323,860 KB
testcase_28 AC 529 ms
382,844 KB
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 5 ms
6,476 KB
testcase_34 AC 4 ms
5,656 KB
testcase_35 AC 5 ms
6,244 KB
testcase_36 AC 7 ms
7,912 KB
testcase_37 AC 7 ms
7,872 KB
testcase_38 AC 67 ms
51,960 KB
testcase_39 AC 72 ms
56,516 KB
testcase_40 AC 184 ms
136,840 KB
testcase_41 AC 224 ms
162,444 KB
testcase_42 AC 103 ms
78,464 KB
testcase_43 AC 35 ms
29,284 KB
testcase_44 MLE -
testcase_45 AC 59 ms
46,232 KB
testcase_46 AC 43 ms
36,028 KB
testcase_47 MLE -
testcase_48 AC 588 ms
426,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
#define REP(i,n,N) for(ll i=(n); i<(N); i++)
#define RREP(i,n,N) for(ll i=(N-1); i>=n; i--)
#define CK(n,a,b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(),(v).end()
#define p(s) cout<<(s)<<endl
#define p2(a,b) cout<<(a)<<" "<<(b)<<endl
#define v2(T) vector<vector<T>>
typedef long long ll;
using namespace std;
const ll mod= 1e9;


ll dp[10010][10100];
int main(){
    ll N, M;
    cin >> N >> M;
    N/=1000LL;
    N%=M;
    dp[0][0]=1;
    REP(i,0,M){
        REP(j,0,N+1){
            (dp[i+1][j] += dp[i][j]) %= mod;
            if(j+1<=N) (dp[i+1][j+1] += dp[i][j]) %= mod;
        }
    }
    p(dp[M][N]);
    return 0;
}
0