結果

問題 No.23 技の選択
ユーザー akakimidoriakakimidori
提出日時 2017-04-19 15:47:40
言語 C90
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 493 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 26,412 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-26 15:18:12
合計ジャッジ時間 4,276 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 0 ms
4,376 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 0 ms
4,376 KB
testcase_09 AC 0 ms
4,376 KB
testcase_10 WA -
testcase_11 AC 0 ms
4,376 KB
testcase_12 RE -
testcase_13 WA -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 0 ms
4,380 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 AC 0 ms
4,380 KB
testcase_26 RE -
testcase_27 AC 1 ms
4,376 KB
testcase_28 RE -
testcase_29 RE -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#define MIN(a,b) ((a)<(b)?(a):(b))

void run(void){
  int h,a,d;
  scanf("%d%d%d",&h,&a,&d);

  if(d<=a){
    printf("%d\n",(h+a-1)/a);
  }

  double *e=(double *)malloc(sizeof(double)*(h+1));
  e[0]=0;
  int i;
  for(i=1;i<=a;i++){
    e[i]=1;
  }
  for(i=a+1;i<=d;i++){
    e[i]=MIN(1+e[i-a],1.5);
  }
  for(i=d+1;i<=h;i++){
    e[i]=MIN(1+e[i-a],1.5+e[i-d]);
  }
  printf("%.2lf\n",e[h]);
  free(e);
  return;
}

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