結果

問題 No.804 野菜が苦手
ユーザー harhogefooharhogefoo
提出日時 2019-04-07 23:16:00
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 353 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 12,072 KB
実行使用メモリ 12,356 KB
最終ジャッジ日時 2023-09-10 10:50:12
合計ジャッジ時間 1,650 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 7 ms
12,220 KB
testcase_02 AC 8 ms
12,264 KB
testcase_03 AC 8 ms
12,176 KB
testcase_04 AC 8 ms
12,204 KB
testcase_05 AC 7 ms
12,252 KB
testcase_06 AC 7 ms
12,244 KB
testcase_07 AC 8 ms
12,148 KB
testcase_08 WA -
testcase_09 AC 7 ms
12,264 KB
testcase_10 AC 7 ms
12,196 KB
testcase_11 AC 7 ms
12,236 KB
testcase_12 AC 8 ms
12,192 KB
testcase_13 AC 7 ms
12,264 KB
testcase_14 AC 7 ms
12,132 KB
testcase_15 AC 7 ms
12,240 KB
testcase_16 AC 7 ms
12,144 KB
testcase_17 AC 7 ms
12,184 KB
testcase_18 AC 7 ms
12,172 KB
testcase_19 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
  list($vegCount, $meatCount, $reg, $max) = explode(" ", trim(fgets(STDIN)));

  $maxVegCount = $vegCount;
  if ($max < $vegCount) {
    $maxVegCount = $max;
  }

  $result = 0;
  for ($i = $maxVegCount; $i >= 0; $i--) {
    if ($i * $reg <= $meatCount && $meatCount + $i <= $max) {
      $result = $i;
      break;
    }
  }

  printf("$result");
0