結果

問題 No.129 お年玉(2)
ユーザー sugim48sugim48
提出日時 2015-01-16 23:27:18
言語 C++11
(gcc 8.5.0)
結果
AC  
実行時間 378 ms / 5,000 ms
コード長 900 bytes
コンパイル時間 1,542 ms
実行使用メモリ 456,064 KB
最終ジャッジ日時 2022-12-06 19:33:41
合計ジャッジ時間 22,070 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 334 ms
456,060 KB
testcase_01 AC 334 ms
456,064 KB
testcase_02 AC 332 ms
455,948 KB
testcase_03 AC 331 ms
454,064 KB
testcase_04 AC 327 ms
455,888 KB
testcase_05 AC 329 ms
454,128 KB
testcase_06 AC 330 ms
456,052 KB
testcase_07 AC 333 ms
456,056 KB
testcase_08 AC 325 ms
454,176 KB
testcase_09 AC 327 ms
454,180 KB
testcase_10 AC 325 ms
455,952 KB
testcase_11 AC 328 ms
456,012 KB
testcase_12 AC 326 ms
455,960 KB
testcase_13 AC 324 ms
455,956 KB
testcase_14 AC 325 ms
454,188 KB
testcase_15 AC 328 ms
454,176 KB
testcase_16 AC 327 ms
454,124 KB
testcase_17 AC 327 ms
454,076 KB
testcase_18 AC 337 ms
456,048 KB
testcase_19 AC 329 ms
454,124 KB
testcase_20 AC 334 ms
455,888 KB
testcase_21 AC 325 ms
454,012 KB
testcase_22 AC 327 ms
456,000 KB
testcase_23 AC 327 ms
455,952 KB
testcase_24 AC 328 ms
455,956 KB
testcase_25 AC 330 ms
454,136 KB
testcase_26 AC 333 ms
455,956 KB
testcase_27 AC 339 ms
454,072 KB
testcase_28 AC 337 ms
454,076 KB
testcase_29 AC 335 ms
454,100 KB
testcase_30 AC 353 ms
454,012 KB
testcase_31 AC 356 ms
456,052 KB
testcase_32 AC 344 ms
456,048 KB
testcase_33 AC 350 ms
454,184 KB
testcase_34 AC 346 ms
454,008 KB
testcase_35 AC 339 ms
454,176 KB
testcase_36 AC 342 ms
455,952 KB
testcase_37 AC 361 ms
454,092 KB
testcase_38 AC 337 ms
454,188 KB
testcase_39 AC 334 ms
454,012 KB
testcase_40 AC 378 ms
454,120 KB
testcase_41 AC 367 ms
456,056 KB
testcase_42 AC 368 ms
454,124 KB
testcase_43 AC 374 ms
456,004 KB
testcase_44 AC 372 ms
456,056 KB
testcase_45 AC 351 ms
454,176 KB
testcase_46 AC 344 ms
455,956 KB
testcase_47 AC 350 ms
454,012 KB
testcase_48 AC 341 ms
454,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v, w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

ll C[10001][10001];

int main() {
	for (int i = 0; i <= 10000; i++) {
		C[i][0] = 1;
		for (int j = 1; j <= i; j++)
			C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % 1000000000;
	}
	ll N; int M; cin >> N >> M;
	N /= 1000;
	N -= N / M * M;
	cout << C[M][N] << endl;
}
0