結果

問題 No.129 お年玉(2)
ユーザー tsutajtsutaj
提出日時 2017-07-05 09:26:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 492 ms / 5,000 ms
コード長 842 bytes
コンパイル時間 2,130 ms
コンパイル使用メモリ 165,780 KB
実行使用メモリ 433,280 KB
最終ジャッジ日時 2024-05-05 23:28:22
合計ジャッジ時間 20,702 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 492 ms
433,152 KB
testcase_01 AC 349 ms
433,024 KB
testcase_02 AC 354 ms
433,024 KB
testcase_03 AC 354 ms
433,024 KB
testcase_04 AC 353 ms
433,024 KB
testcase_05 AC 351 ms
433,024 KB
testcase_06 AC 349 ms
433,152 KB
testcase_07 AC 359 ms
433,152 KB
testcase_08 AC 359 ms
433,280 KB
testcase_09 AC 362 ms
433,152 KB
testcase_10 AC 360 ms
433,152 KB
testcase_11 AC 354 ms
433,152 KB
testcase_12 AC 355 ms
433,152 KB
testcase_13 AC 353 ms
433,152 KB
testcase_14 AC 356 ms
433,152 KB
testcase_15 AC 352 ms
433,152 KB
testcase_16 AC 352 ms
433,152 KB
testcase_17 AC 357 ms
433,152 KB
testcase_18 AC 357 ms
433,152 KB
testcase_19 AC 352 ms
433,152 KB
testcase_20 AC 350 ms
433,152 KB
testcase_21 AC 355 ms
433,152 KB
testcase_22 AC 350 ms
433,152 KB
testcase_23 AC 357 ms
433,024 KB
testcase_24 AC 358 ms
433,024 KB
testcase_25 AC 349 ms
433,280 KB
testcase_26 AC 357 ms
433,152 KB
testcase_27 AC 354 ms
433,152 KB
testcase_28 AC 353 ms
433,152 KB
testcase_29 AC 361 ms
433,024 KB
testcase_30 AC 351 ms
433,152 KB
testcase_31 AC 357 ms
433,152 KB
testcase_32 AC 361 ms
433,024 KB
testcase_33 AC 358 ms
433,152 KB
testcase_34 AC 366 ms
433,152 KB
testcase_35 AC 358 ms
433,152 KB
testcase_36 AC 359 ms
433,152 KB
testcase_37 AC 355 ms
433,280 KB
testcase_38 AC 358 ms
433,152 KB
testcase_39 AC 357 ms
433,152 KB
testcase_40 AC 357 ms
433,152 KB
testcase_41 AC 354 ms
433,152 KB
testcase_42 AC 371 ms
433,152 KB
testcase_43 AC 355 ms
433,024 KB
testcase_44 AC 355 ms
433,152 KB
testcase_45 AC 354 ms
433,152 KB
testcase_46 AC 351 ms
433,152 KB
testcase_47 AC 355 ms
433,152 KB
testcase_48 AC 359 ms
433,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// 基本テンプレート (縮小版)

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
typedef pair<int, int> pii;
typedef long long ll;
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000000LL;

ll comb[10001][10001];

signed main() {
    rep(i,0,10001) comb[i][0] = 1;
    rep(i,1,10001) repq(j,1,i) {
        comb[i][j] = (comb[i-1][j-1] + comb[i-1][j]) % MOD;
    }

    int N, M; cin >> N >> M;
    N /= 1000; N %= M;
    cout << comb[M][N] << endl;
    return 0;
}
0