結果

問題 No.129 お年玉(2)
ユーザー akakimidoriakakimidori
提出日時 2017-06-10 22:09:58
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 155 ms / 5,000 ms
コード長 475 bytes
コンパイル時間 1,085 ms
コンパイル使用メモリ 25,248 KB
実行使用メモリ 360,376 KB
最終ジャッジ日時 2023-08-18 17:55:43
合計ジャッジ時間 5,444 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
20,708 KB
testcase_01 AC 155 ms
357,380 KB
testcase_02 AC 0 ms
4,380 KB
testcase_03 AC 0 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 60 ms
160,056 KB
testcase_06 AC 96 ms
253,208 KB
testcase_07 AC 121 ms
302,792 KB
testcase_08 AC 82 ms
211,684 KB
testcase_09 AC 108 ms
282,716 KB
testcase_10 AC 120 ms
312,356 KB
testcase_11 AC 77 ms
203,180 KB
testcase_12 AC 103 ms
264,728 KB
testcase_13 AC 106 ms
274,812 KB
testcase_14 AC 102 ms
266,688 KB
testcase_15 AC 87 ms
221,004 KB
testcase_16 AC 96 ms
250,764 KB
testcase_17 AC 117 ms
297,784 KB
testcase_18 AC 111 ms
283,280 KB
testcase_19 AC 117 ms
299,848 KB
testcase_20 AC 116 ms
297,460 KB
testcase_21 AC 145 ms
355,504 KB
testcase_22 AC 81 ms
214,496 KB
testcase_23 AC 124 ms
320,180 KB
testcase_24 AC 118 ms
309,436 KB
testcase_25 AC 76 ms
203,996 KB
testcase_26 AC 77 ms
209,584 KB
testcase_27 AC 76 ms
203,108 KB
testcase_28 AC 145 ms
358,144 KB
testcase_29 AC 0 ms
4,380 KB
testcase_30 AC 0 ms
4,376 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 1 ms
4,380 KB
testcase_33 AC 2 ms
4,380 KB
testcase_34 AC 1 ms
4,380 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 2 ms
4,380 KB
testcase_37 AC 2 ms
4,976 KB
testcase_38 AC 17 ms
42,236 KB
testcase_39 AC 25 ms
64,832 KB
testcase_40 AC 73 ms
189,840 KB
testcase_41 AC 45 ms
114,104 KB
testcase_42 AC 19 ms
49,244 KB
testcase_43 AC 18 ms
47,192 KB
testcase_44 AC 145 ms
360,376 KB
testcase_45 AC 11 ms
26,276 KB
testcase_46 AC 28 ms
73,496 KB
testcase_47 AC 143 ms
350,112 KB
testcase_48 AC 88 ms
223,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<stdlib.h>

void run(void){
  long long int n;
  int m;
  scanf("%lld%d",&n,&m);
  int t=(int)(n%(1000*m))/1000;

  int *comb=(int *)calloc((m+1)*(m+1),sizeof(int));
  comb[0]=1;
  const int mod=1000000000;
  int i,j;
  for(i=1;i<=m;i++){
    comb[i*(m+1)]=1;
    for(j=1;j<=i;j++){
      comb[i*(m+1)+j]=(comb[(i-1)*(m+1)+j-1]+comb[(i-1)*(m+1)+j])%mod;
    }
  }
  printf("%d\n",comb[m*(m+1)+t]);
  return;
}

int main(void){
  run();
  return 0;
}
0