結果

問題 No.129 お年玉(2)
ユーザー BantakoBantako
提出日時 2017-08-11 01:03:13
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 515 ms / 5,000 ms
コード長 408 bytes
コンパイル時間 2,074 ms
コンパイル使用メモリ 165,980 KB
実行使用メモリ 236,800 KB
最終ジャッジ日時 2024-05-05 23:36:50
合計ジャッジ時間 14,267 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
22,016 KB
testcase_01 AC 473 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 205 ms
108,544 KB
testcase_06 AC 314 ms
162,304 KB
testcase_07 AC 385 ms
194,560 KB
testcase_08 AC 270 ms
138,368 KB
testcase_09 AC 378 ms
180,736 KB
testcase_10 AC 443 ms
200,960 KB
testcase_11 AC 286 ms
133,376 KB
testcase_12 AC 368 ms
169,088 KB
testcase_13 AC 350 ms
175,872 KB
testcase_14 AC 337 ms
170,624 KB
testcase_15 AC 275 ms
143,488 KB
testcase_16 AC 312 ms
160,768 KB
testcase_17 AC 380 ms
191,232 KB
testcase_18 AC 365 ms
181,376 KB
testcase_19 AC 379 ms
192,256 KB
testcase_20 AC 380 ms
190,848 KB
testcase_21 AC 477 ms
232,192 KB
testcase_22 AC 271 ms
139,776 KB
testcase_23 AC 418 ms
206,592 KB
testcase_24 AC 401 ms
199,296 KB
testcase_25 AC 282 ms
134,144 KB
testcase_26 AC 267 ms
137,088 KB
testcase_27 AC 256 ms
133,376 KB
testcase_28 AC 514 ms
234,112 KB
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 3 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 2 ms
5,376 KB
testcase_33 AC 7 ms
7,680 KB
testcase_34 AC 4 ms
5,504 KB
testcase_35 AC 7 ms
7,168 KB
testcase_36 AC 7 ms
7,680 KB
testcase_37 AC 8 ms
8,448 KB
testcase_38 AC 65 ms
37,120 KB
testcase_39 AC 97 ms
51,840 KB
testcase_40 AC 255 ms
125,440 KB
testcase_41 AC 151 ms
81,792 KB
testcase_42 AC 66 ms
40,960 KB
testcase_43 AC 69 ms
40,576 KB
testcase_44 AC 474 ms
235,008 KB
testcase_45 AC 45 ms
26,368 KB
testcase_46 AC 102 ms
56,960 KB
testcase_47 AC 515 ms
228,480 KB
testcase_48 AC 304 ms
145,024 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1e9;
int MOD = 1e9;
int dp[10010][10010];
main(){
    ll N,M;
    cin >> N >> M;
    dp[0][0] = 1;
    for(int i = 0;i <= M;i++){
        for(int j = 0;j <= i;j++){
            dp[i+1][j] = (dp[i+1][j] + dp[i][j])%MOD;
            dp[i+1][j+1] = (dp[i+1][j+1] + dp[i][j])%MOD;
        }
    }
    cout << dp[M][N/1000%M] << endl;
}
0