結果

問題 No.804 野菜が苦手
ユーザー proriboneproribone
提出日時 2019-06-03 18:06:29
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 263 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 29,524 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 23:27:41
合計ジャッジ時間 1,346 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 0 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,348 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<math.h>

int main(){
  int a,b,c,d;
  int ans=0;
  scanf("%d%d%d%d",&a,&b,&c,&d);
  if(c>b){
    printf("%d",0);
    return 0;
  }
  while(d>0&&a>0&&b>0){
    a-=1;
    b-=c;
    d-=c+1;
    ans++;
  }
  printf("%d",ans);
  return 0;
}
0