結果

問題 No.129 お年玉(2)
ユーザー zuvizudarzuvizudar
提出日時 2017-06-18 13:08:44
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 385 ms / 5,000 ms
コード長 1,068 bytes
コンパイル時間 1,155 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 433,280 KB
最終ジャッジ日時 2024-05-05 23:27:02
合計ジャッジ時間 19,614 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 385 ms
433,024 KB
testcase_01 AC 343 ms
433,152 KB
testcase_02 AC 341 ms
433,152 KB
testcase_03 AC 348 ms
433,024 KB
testcase_04 AC 348 ms
433,024 KB
testcase_05 AC 336 ms
433,024 KB
testcase_06 AC 338 ms
433,024 KB
testcase_07 AC 337 ms
433,152 KB
testcase_08 AC 331 ms
433,024 KB
testcase_09 AC 338 ms
433,024 KB
testcase_10 AC 337 ms
433,024 KB
testcase_11 AC 334 ms
433,152 KB
testcase_12 AC 343 ms
433,280 KB
testcase_13 AC 335 ms
433,152 KB
testcase_14 AC 337 ms
433,024 KB
testcase_15 AC 336 ms
433,024 KB
testcase_16 AC 335 ms
433,152 KB
testcase_17 AC 337 ms
433,024 KB
testcase_18 AC 342 ms
433,152 KB
testcase_19 AC 331 ms
433,024 KB
testcase_20 AC 333 ms
433,024 KB
testcase_21 AC 337 ms
433,024 KB
testcase_22 AC 343 ms
433,152 KB
testcase_23 AC 342 ms
433,024 KB
testcase_24 AC 349 ms
433,024 KB
testcase_25 AC 344 ms
433,024 KB
testcase_26 AC 338 ms
433,152 KB
testcase_27 AC 340 ms
433,152 KB
testcase_28 AC 338 ms
433,152 KB
testcase_29 AC 344 ms
433,024 KB
testcase_30 AC 334 ms
433,024 KB
testcase_31 AC 332 ms
433,152 KB
testcase_32 AC 336 ms
433,024 KB
testcase_33 AC 332 ms
433,280 KB
testcase_34 AC 331 ms
433,152 KB
testcase_35 AC 336 ms
433,024 KB
testcase_36 AC 331 ms
433,024 KB
testcase_37 AC 331 ms
433,024 KB
testcase_38 AC 337 ms
433,152 KB
testcase_39 AC 335 ms
433,024 KB
testcase_40 AC 336 ms
433,152 KB
testcase_41 AC 337 ms
433,024 KB
testcase_42 AC 333 ms
433,152 KB
testcase_43 AC 336 ms
433,024 KB
testcase_44 AC 331 ms
433,152 KB
testcase_45 AC 329 ms
433,024 KB
testcase_46 AC 336 ms
433,024 KB
testcase_47 AC 335 ms
433,024 KB
testcase_48 AC 332 ms
433,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>
 
using namespace std;
 
#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 pb push_back
 
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef long long ll;

	ll pascal[10001][10001];
int main(){
	ll N,M;
	ll mod=1e9;
	cin>>N>>M;
	for(int i=0;i<=10000;i++){
		for(int j=0;j<=i;j++){
			if(j==0)pascal[i][j]=1;
			else
				pascal[i][j]=(pascal[i-1][j]+pascal[i-1][j-1])%mod;
		}
	}
	cout<<pascal[M][N/1000%M]<<endl;
	return 0;
}
0