結果

問題 No.129 お年玉(2)
ユーザー fiordfiord
提出日時 2015-08-03 22:41:08
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 380 ms / 5,000 ms
コード長 416 bytes
コンパイル時間 371 ms
コンパイル使用メモリ 34,396 KB
実行使用メモリ 431,232 KB
最終ジャッジ日時 2024-04-21 10:37:39
合計ジャッジ時間 20,915 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 380 ms
431,232 KB
testcase_01 AC 374 ms
431,232 KB
testcase_02 AC 374 ms
431,232 KB
testcase_03 AC 377 ms
431,232 KB
testcase_04 AC 374 ms
431,232 KB
testcase_05 AC 372 ms
431,232 KB
testcase_06 AC 375 ms
431,232 KB
testcase_07 AC 373 ms
431,232 KB
testcase_08 AC 373 ms
431,232 KB
testcase_09 AC 374 ms
431,232 KB
testcase_10 AC 372 ms
431,232 KB
testcase_11 AC 373 ms
431,232 KB
testcase_12 AC 376 ms
431,232 KB
testcase_13 AC 373 ms
431,232 KB
testcase_14 AC 380 ms
431,232 KB
testcase_15 AC 374 ms
431,232 KB
testcase_16 AC 373 ms
431,232 KB
testcase_17 AC 374 ms
431,232 KB
testcase_18 AC 371 ms
431,232 KB
testcase_19 AC 379 ms
431,232 KB
testcase_20 AC 374 ms
431,232 KB
testcase_21 AC 375 ms
431,232 KB
testcase_22 AC 373 ms
431,104 KB
testcase_23 AC 371 ms
431,232 KB
testcase_24 AC 374 ms
431,104 KB
testcase_25 AC 373 ms
431,232 KB
testcase_26 AC 372 ms
431,232 KB
testcase_27 AC 373 ms
431,232 KB
testcase_28 AC 371 ms
431,104 KB
testcase_29 AC 374 ms
431,104 KB
testcase_30 AC 372 ms
431,232 KB
testcase_31 AC 373 ms
431,232 KB
testcase_32 AC 373 ms
431,232 KB
testcase_33 AC 370 ms
431,232 KB
testcase_34 AC 376 ms
431,104 KB
testcase_35 AC 376 ms
431,232 KB
testcase_36 AC 375 ms
431,232 KB
testcase_37 AC 373 ms
431,232 KB
testcase_38 AC 373 ms
431,232 KB
testcase_39 AC 374 ms
431,232 KB
testcase_40 AC 370 ms
431,232 KB
testcase_41 AC 372 ms
431,232 KB
testcase_42 AC 374 ms
431,232 KB
testcase_43 AC 375 ms
431,232 KB
testcase_44 AC 377 ms
431,232 KB
testcase_45 AC 374 ms
431,232 KB
testcase_46 AC 374 ms
431,232 KB
testcase_47 AC 376 ms
431,232 KB
testcase_48 AC 374 ms
431,232 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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