結果

問題 No.129 お年玉(2)
ユーザー %20%20
提出日時 2017-01-02 12:59:48
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 218 ms / 5,000 ms
コード長 212 bytes
コンパイル時間 558 ms
コンパイル使用メモリ 24,060 KB
実行使用メモリ 355,380 KB
最終ジャッジ日時 2023-08-18 17:45:14
合計ジャッジ時間 6,822 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
88,080 KB
testcase_01 AC 218 ms
355,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 0 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 96 ms
227,076 KB
testcase_06 AC 143 ms
280,712 KB
testcase_07 AC 175 ms
313,268 KB
testcase_08 AC 123 ms
256,928 KB
testcase_09 AC 159 ms
299,436 KB
testcase_10 AC 180 ms
319,604 KB
testcase_11 AC 118 ms
251,792 KB
testcase_12 AC 147 ms
287,480 KB
testcase_13 AC 153 ms
294,676 KB
testcase_14 AC 146 ms
289,248 KB
testcase_15 AC 127 ms
262,080 KB
testcase_16 AC 139 ms
279,424 KB
testcase_17 AC 168 ms
309,816 KB
testcase_18 AC 157 ms
299,820 KB
testcase_19 AC 168 ms
310,788 KB
testcase_20 AC 167 ms
309,456 KB
testcase_21 AC 210 ms
350,732 KB
testcase_22 AC 126 ms
258,280 KB
testcase_23 AC 183 ms
324,984 KB
testcase_24 AC 177 ms
317,880 KB
testcase_25 AC 120 ms
252,700 KB
testcase_26 AC 122 ms
255,608 KB
testcase_27 AC 119 ms
251,728 KB
testcase_28 AC 212 ms
352,652 KB
testcase_29 AC 0 ms
4,376 KB
testcase_30 AC 1 ms
4,376 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 1 ms
4,376 KB
testcase_33 AC 7 ms
30,684 KB
testcase_34 AC 4 ms
18,388 KB
testcase_35 AC 7 ms
28,636 KB
testcase_36 AC 7 ms
30,824 KB
testcase_37 AC 8 ms
34,924 KB
testcase_38 AC 34 ms
129,116 KB
testcase_39 AC 45 ms
159,720 KB
testcase_40 AC 116 ms
244,072 KB
testcase_41 AC 70 ms
200,388 KB
testcase_42 AC 37 ms
137,320 KB
testcase_43 AC 36 ms
135,276 KB
testcase_44 AC 213 ms
353,744 KB
testcase_45 AC 25 ms
100,364 KB
testcase_46 AC 49 ms
170,080 KB
testcase_47 AC 206 ms
346,992 KB
testcase_48 AC 129 ms
263,612 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
 C[10001][10001];
 ^
main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘C’ [-Wimplicit-int]
main.c:3:1: warning: data definition has no type or storage class
 i,j,k;
 ^
main.c:3:1: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int]
main.c:3:3: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int]
 i,j,k;
   ^
main.c:3:5: warning: type defaults to ‘int’ in declaration of ‘k’ [-Wimplicit-int]
 i,j,k;
     ^
main.c:4:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 main(M){
 ^~~~
main.c: In function ‘main’:
main.c:4:1: warning: type of ‘M’ defaults to ‘int’ [-Wimplicit-int]
main.c:5:2: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
  scanf("%lld%d",&N,&M);
  ^~~~~
main.c:5:2: warning: incompatible implicit declaration of built-in function ‘scanf’
main.c:5:2: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:1:1:
+#include <stdio.h>
 C[10001][10001];
main.c:5:2:
  scanf("%lld%d",&N,&M);
  ^~~~~
main.c:10:2: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
  printf("%d\n",C[M][k]);
  ^~~~~~
main.c:10:2: warning: incompatible implicit declaration of built-in function ‘printf’
main.c:10:2: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’

ソースコード

diff #

C[10001][10001];
long long N;
i,j,k;
main(M){
	scanf("%lld%d",&N,&M);
	k=N/1000%M;
	for(;i<=M;++i)
		for(C[i][0]=j=1;j<=i;++j)
			C[i][j]=(C[i-1][j-1]+C[i-1][j])%1000000000;
	printf("%d\n",C[M][k]);
	return 0;
}
0