結果

問題 No.129 お年玉(2)
ユーザー h_nosonh_noson
提出日時 2016-02-26 09:29:32
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 366 ms / 5,000 ms
コード長 632 bytes
コンパイル時間 524 ms
コンパイル使用メモリ 65,124 KB
実行使用メモリ 394,612 KB
最終ジャッジ日時 2023-08-18 17:34:13
合計ジャッジ時間 9,652 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
22,724 KB
testcase_01 AC 366 ms
394,612 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 144 ms
162,624 KB
testcase_06 AC 224 ms
256,948 KB
testcase_07 AC 278 ms
314,868 KB
testcase_08 AC 190 ms
214,776 KB
testcase_09 AC 256 ms
289,860 KB
testcase_10 AC 282 ms
326,324 KB
testcase_11 AC 186 ms
205,932 KB
testcase_12 AC 235 ms
268,956 KB
testcase_13 AC 248 ms
281,556 KB
testcase_14 AC 240 ms
271,812 KB
testcase_15 AC 200 ms
223,812 KB
testcase_16 AC 221 ms
254,252 KB
testcase_17 AC 269 ms
308,736 KB
testcase_18 AC 255 ms
290,808 KB
testcase_19 AC 276 ms
310,396 KB
testcase_20 AC 272 ms
307,908 KB
testcase_21 AC 342 ms
385,204 KB
testcase_22 AC 196 ms
217,112 KB
testcase_23 AC 294 ms
336,576 KB
testcase_24 AC 286 ms
323,100 KB
testcase_25 AC 185 ms
207,076 KB
testcase_26 AC 189 ms
212,304 KB
testcase_27 AC 188 ms
205,756 KB
testcase_28 AC 340 ms
389,060 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 1 ms
4,376 KB
testcase_33 AC 4 ms
5,780 KB
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 3 ms
5,332 KB
testcase_36 AC 4 ms
5,784 KB
testcase_37 AC 4 ms
6,540 KB
testcase_38 AC 42 ms
44,960 KB
testcase_39 AC 64 ms
68,140 KB
testcase_40 AC 171 ms
192,244 KB
testcase_41 AC 106 ms
117,376 KB
testcase_42 AC 45 ms
50,964 KB
testcase_43 AC 44 ms
50,188 KB
testcase_44 AC 339 ms
391,236 KB
testcase_45 AC 27 ms
28,896 KB
testcase_46 AC 74 ms
76,236 KB
testcase_47 AC 329 ms
377,932 KB
testcase_48 AC 197 ms
226,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

#define RREP(i,s,e) for (i = e-1; i >= s; i--)
#define rrep(i,n) RREP(i,0,n)
#define REP(i,s,e) for (i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
#define INF 1e8

typedef long long ll;

int main() {
    int i, j, m, ans;
    ll n;
    cin >> n >> m;
    vector<int> dp[m+1];
    rep (i,m+1) dp[i].resize(m+1);
    n /= 1000;
    n %= m;
    rep (i,m+1) {
        dp[i][0] = 1;
        REP (j,1,i+1) {
            dp[i][j] = dp[i-1][j-1] + dp[i-1][j];
            dp[i][j] %= 1000000000;
        }
    }
    cout << dp[m][n] << endl;
    return 0;
}
0