結果

問題 No.129 お年玉(2)
ユーザー ant2357ant2357
提出日時 2017-04-05 00:27:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 238 ms / 5,000 ms
コード長 1,219 bytes
コンパイル時間 1,597 ms
コンパイル使用メモリ 164,224 KB
実行使用メモリ 385,516 KB
最終ジャッジ日時 2023-08-18 17:51:56
合計ジャッジ時間 8,481 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
89,728 KB
testcase_01 AC 238 ms
349,748 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 104 ms
221,440 KB
testcase_06 AC 164 ms
275,048 KB
testcase_07 AC 181 ms
307,680 KB
testcase_08 AC 126 ms
251,224 KB
testcase_09 AC 165 ms
321,004 KB
testcase_10 AC 184 ms
341,544 KB
testcase_11 AC 119 ms
273,620 KB
testcase_12 AC 155 ms
309,308 KB
testcase_13 AC 163 ms
316,344 KB
testcase_14 AC 158 ms
310,976 KB
testcase_15 AC 129 ms
283,660 KB
testcase_16 AC 148 ms
301,100 KB
testcase_17 AC 177 ms
331,620 KB
testcase_18 AC 167 ms
321,708 KB
testcase_19 AC 180 ms
332,784 KB
testcase_20 AC 164 ms
341,160 KB
testcase_21 AC 203 ms
382,316 KB
testcase_22 AC 110 ms
290,244 KB
testcase_23 AC 179 ms
356,752 KB
testcase_24 AC 171 ms
349,568 KB
testcase_25 AC 104 ms
284,236 KB
testcase_26 AC 105 ms
288,208 KB
testcase_27 AC 103 ms
284,112 KB
testcase_28 AC 206 ms
384,300 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 9 ms
32,268 KB
testcase_34 AC 7 ms
19,920 KB
testcase_35 AC 9 ms
30,220 KB
testcase_36 AC 9 ms
32,280 KB
testcase_37 AC 10 ms
36,432 KB
testcase_38 AC 38 ms
130,564 KB
testcase_39 AC 52 ms
161,312 KB
testcase_40 AC 99 ms
274,136 KB
testcase_41 AC 69 ms
212,504 KB
testcase_42 AC 40 ms
138,728 KB
testcase_43 AC 39 ms
136,828 KB
testcase_44 AC 206 ms
385,516 KB
testcase_45 AC 29 ms
101,896 KB
testcase_46 AC 55 ms
171,528 KB
testcase_47 AC 200 ms
378,636 KB
testcase_48 AC 113 ms
295,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

using namespace std;

using LL = long long int;
using LD = long double;

using pii = pair<int, int>;
using pll = pair<LL, LL>;
using pdd = pair<double, double>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vl = vector<LL>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using vd = vector<double>;
using vvd = vector<vd>;
using vs = vector<string>;
using vb = vector<bool>;
using vvb = vector<vb>;

const int INF = (1 << 30) - 1;
const LL INF64 = ((LL)1 << 62) - 1;
const double PI = 3.1415926535897932384626433832795;

const int dy[] = { 0, 1, 0, -1 };
const int dx[] = { 1, 0, -1, 0 };

int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
LL gcd(LL x, LL y) { return y ? gcd(y, x % y) : x; }

int dp[10001][10001];
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	LL n, m;
	cin >> n >> m;
	n /= 1000;

	for (int i = 0; i <= m; i++) {
		dp[i][0] = 1;
		for (int j = 1; j <= i; j++) {
			dp[i][j] = (dp[i - 1][j - 1] + dp[i - 1][j]) % 1000000000;
		}
	}

	cout << dp[m][n % m] << endl;
	return 0;
}
0