結果

問題 No.129 お年玉(2)
ユーザー BantakoBantako
提出日時 2017-08-11 01:03:13
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 509 ms / 5,000 ms
コード長 408 bytes
コンパイル時間 1,750 ms
コンパイル使用メモリ 164,988 KB
実行使用メモリ 236,932 KB
最終ジャッジ日時 2023-08-18 18:02:26
合計ジャッジ時間 14,436 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
21,892 KB
testcase_01 AC 509 ms
236,932 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 220 ms
108,384 KB
testcase_06 AC 338 ms
162,332 KB
testcase_07 AC 412 ms
194,608 KB
testcase_08 AC 287 ms
138,340 KB
testcase_09 AC 383 ms
180,684 KB
testcase_10 AC 425 ms
201,000 KB
testcase_11 AC 274 ms
133,264 KB
testcase_12 AC 354 ms
168,952 KB
testcase_13 AC 369 ms
175,888 KB
testcase_14 AC 359 ms
170,516 KB
testcase_15 AC 299 ms
143,332 KB
testcase_16 AC 340 ms
160,708 KB
testcase_17 AC 403 ms
191,380 KB
testcase_18 AC 383 ms
181,236 KB
testcase_19 AC 407 ms
192,136 KB
testcase_20 AC 403 ms
190,944 KB
testcase_21 AC 498 ms
231,980 KB
testcase_22 AC 290 ms
139,620 KB
testcase_23 AC 436 ms
206,408 KB
testcase_24 AC 423 ms
199,176 KB
testcase_25 AC 277 ms
133,968 KB
testcase_26 AC 281 ms
136,880 KB
testcase_27 AC 273 ms
133,360 KB
testcase_28 AC 500 ms
233,920 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 2 ms
4,376 KB
testcase_33 AC 8 ms
7,616 KB
testcase_34 AC 4 ms
5,468 KB
testcase_35 AC 7 ms
7,100 KB
testcase_36 AC 8 ms
7,600 KB
testcase_37 AC 9 ms
8,484 KB
testcase_38 AC 66 ms
37,104 KB
testcase_39 AC 96 ms
52,008 KB
testcase_40 AC 256 ms
125,504 KB
testcase_41 AC 161 ms
81,800 KB
testcase_42 AC 73 ms
41,024 KB
testcase_43 AC 73 ms
40,496 KB
testcase_44 AC 503 ms
235,016 KB
testcase_45 AC 43 ms
26,212 KB
testcase_46 AC 107 ms
56,828 KB
testcase_47 AC 487 ms
228,312 KB
testcase_48 AC 303 ms
145,128 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-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