結果

問題 No.388 階段 (1)
ユーザー SATSUKI-UPDATESATSUKI-UPDATE
提出日時 2022-05-16 21:01:16
言語 PHP
(8.3.4)
結果
AC  
実行時間 8 ms / 2,000 ms
コード長 619 bytes
コンパイル時間 904 ms
コンパイル使用メモリ 12,004 KB
実行使用メモリ 12,356 KB
最終ジャッジ日時 2023-10-12 15:21:35
合計ジャッジ時間 1,847 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
12,284 KB
testcase_01 AC 7 ms
12,296 KB
testcase_02 AC 7 ms
12,260 KB
testcase_03 AC 7 ms
12,300 KB
testcase_04 AC 8 ms
12,348 KB
testcase_05 AC 8 ms
12,356 KB
testcase_06 AC 7 ms
12,248 KB
testcase_07 AC 8 ms
12,348 KB
testcase_08 AC 7 ms
12,296 KB
testcase_09 AC 7 ms
12,352 KB
testcase_10 AC 7 ms
12,296 KB
testcase_11 AC 8 ms
12,280 KB
testcase_12 AC 8 ms
12,352 KB
testcase_13 AC 7 ms
12,264 KB
testcase_14 AC 8 ms
12,272 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
//https://atcoder.jp/contests/abs/tasks/practice_1
function getStandardInput()
{
  $array = array();
  while (true) {
    $stdin = fgets(STDIN);
    if ($stdin == "") {
      break;
    }
    $array[] = rtrim($stdin);
  }
  return $array;
}

function splitBySpace($str)
{
  return explode(' ', $str);
}

$stdIn = getStandardInput();
$conditions = splitBySpace($stdIn[0]);

$nowFloor = $conditions[0];
$houseHeight = $conditions[1];

$result = $nowFloor / $houseHeight;

if($result < 1){
    $result = 1;
} else if(is_int($result)){
    $result = $result + 1;
} else {
   $result =  ceil($result);
}
echo($result);
0