結果

問題 No.388 階段 (1)
ユーザー SATSUKI-UPDATE
提出日時 2022-05-16 21:01:16
言語 PHP
(843.2)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 619 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 32,276 KB
実行使用メモリ 32,404 KB
最終ジャッジ日時 2024-09-14 14:08:46
合計ジャッジ時間 1,448 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
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