結果

問題 No.129 お年玉(2)
ユーザー かにかに
提出日時 2015-11-18 01:23:47
言語 C++11
(gcc 11.4.0)
結果
MLE  
実行時間 -
コード長 1,684 bytes
コンパイル時間 841 ms
コンパイル使用メモリ 90,636 KB
実行使用メモリ 784,300 KB
最終ジャッジ日時 2023-10-11 17:55:49
合計ジャッジ時間 16,613 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
176,784 KB
testcase_01 MLE -
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 3 ms
4,352 KB
testcase_04 AC 2 ms
4,352 KB
testcase_05 AC 304 ms
501,736 KB
testcase_06 MLE -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 MLE -
testcase_10 MLE -
testcase_11 MLE -
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 MLE -
testcase_23 MLE -
testcase_24 MLE -
testcase_25 MLE -
testcase_26 MLE -
testcase_27 MLE -
testcase_28 MLE -
testcase_29 AC 1 ms
4,352 KB
testcase_30 AC 2 ms
4,352 KB
testcase_31 AC 4 ms
7,376 KB
testcase_32 AC 4 ms
7,316 KB
testcase_33 AC 27 ms
64,664 KB
testcase_34 AC 16 ms
38,024 KB
testcase_35 AC 25 ms
60,604 KB
testcase_36 AC 27 ms
64,768 KB
testcase_37 AC 30 ms
72,940 KB
testcase_38 AC 106 ms
259,200 KB
testcase_39 AC 131 ms
320,856 KB
testcase_40 MLE -
testcase_41 AC 174 ms
424,904 KB
testcase_42 AC 111 ms
275,588 KB
testcase_43 AC 110 ms
273,556 KB
testcase_44 MLE -
testcase_45 AC 83 ms
204,136 KB
testcase_46 AC 139 ms
339,848 KB
testcase_47 MLE -
testcase_48 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#define aLL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXISt(s,e) ((s).find(e)!=(s).end())
#define INF 1<<25
#define MAX 100000000
#define pb push_back
#define mp make_pair
using namespace std;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef pair<pair<int, int>, int> pp;
typedef long long ll;
int dx[] = { 0, 1, 0, -1 };
int dy[] = { -1, 0, 1, 0 };

int sttoi(std::string str) {
	int ret;
	std::stringstream ss; ss << str;
	ss >> ret;
	return ret;
}

bool sort_greater(const pair<string, int> &a, const pair<string, int> &b) {
	return a.second > b.second;
}
int gcd(int a, int b){
	if (b > a)swap(a, b);if (b == 0)return a;else{return gcd(b, a%b);}
}

ll dp[10001][10001];

void solve() {
	ll n, m;
	cin >> n >> m;
	n /= 1000;
	n %= m;
	dp[0][1] = 1;
	dp[0][2] = 1;
	for (int i = 1; i < m; i++){
		for (int j = 1; j < 9999; j++){
			dp[i][j] = dp[i - 1][j-1] + dp[i - 1][j] % 1000000000;
		}
	}
	P(dp[m-1][n+1]%1000000000);
}

int main() {
	solve();
	return 0;
}
0