結果

問題 No.129 お年玉(2)
ユーザー fiord
提出日時 2015-08-03 22:41:08
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 416 bytes
コンパイル時間 440 ms
コンパイル使用メモリ 34,528 KB
実行使用メモリ 753,896 KB
最終ジャッジ日時 2024-10-13 09:28:10
合計ジャッジ時間 18,860 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample MLE * 3
other AC * 1 MLE * 45
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         ll n,m; scanf("%lld %lld",&n,&m);
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long int ll;
const ll E=1e9;
ll dp[10001][10001];
int main(){
	ll n,m;	scanf("%lld %lld",&n,&m);
	n/=1000;
	n%=m;
	//mCnを求める
	dp[0][0]=1;
	for(int i=1;i<=10000;i++){
		dp[i][0]=1;	dp[i][i]=1;
		for(int j=1;j<=i;j++){
			dp[i][j]=(dp[i-1][j]+dp[i-1][j-1])%E;
		}
	}
	if(dp[m][n]==0)	dp[m][n]++;
	printf("%lld\n",dp[m][n]);
	return 0;
}
0