結果

問題 No.804 野菜が苦手
ユーザー aya
提出日時 2019-08-02 13:35:03
言語 PHP
(843.2)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 30,520 KB
実行使用メモリ 31,216 KB
最終ジャッジ日時 2024-07-05 08:05:14
合計ジャッジ時間 1,828 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$input=explode(" ", (trim(fgets(STDIN))));
$vege=(int)$input[0];
$meat=(int)$input[1];
$meatPerVege=(int)$input[2];
$upperFoodLimit=(int)$input[3];
$upperNmbTimes=floor($upperFoodLimit/(1+$meatPerVege));

if($upperNmbTimes>$vege){
  $upperNmbTimes=$vege;
}
if($upperNmbTimes>$meat/$meatPerVege){
  $upperNmbTimes=floor($meat/$meatPerVege);
}
echo $upperNmbTimes;
0