結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
175,632 KB
testcase_01 MLE -
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 164 ms
394,284 KB
testcase_06 AC 178 ms
453,944 KB
testcase_07 MLE -
testcase_08 MLE -
testcase_09 AC 175 ms
504,652 KB
testcase_10 MLE -
testcase_11 AC 168 ms
485,956 KB
testcase_12 AC 104 ms
442,276 KB
testcase_13 AC 101 ms
438,656 KB
testcase_14 AC 182 ms
511,056 KB
testcase_15 AC 160 ms
482,352 KB
testcase_16 MLE -
testcase_17 AC 165 ms
500,496 KB
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 AC 188 ms
503,676 KB
testcase_23 MLE -
testcase_24 MLE -
testcase_25 AC 166 ms
483,272 KB
testcase_26 MLE -
testcase_27 AC 190 ms
503,756 KB
testcase_28 MLE -
testcase_29 AC 2 ms
4,348 KB
testcase_30 AC 2 ms
4,352 KB
testcase_31 AC 2 ms
5,480 KB
testcase_32 AC 2 ms
5,508 KB
testcase_33 AC 14 ms
63,112 KB
testcase_34 AC 8 ms
36,268 KB
testcase_35 AC 12 ms
56,692 KB
testcase_36 AC 14 ms
63,184 KB
testcase_37 AC 16 ms
71,128 KB
testcase_38 AC 59 ms
257,772 KB
testcase_39 AC 72 ms
321,404 KB
testcase_40 AC 126 ms
450,528 KB
testcase_41 AC 110 ms
422,484 KB
testcase_42 AC 67 ms
274,428 KB
testcase_43 AC 56 ms
271,880 KB
testcase_44 MLE -
testcase_45 AC 48 ms
202,584 KB
testcase_46 AC 72 ms
339,536 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 < n+10; 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