結果

問題 No.388 階段 (1)
ユーザー takimoto111takimoto111
提出日時 2018-04-20 19:01:14
言語 PHP
(8.3.4)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 583 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 18,664 KB
実行使用メモリ 18,904 KB
最終ジャッジ日時 2023-09-09 12:03:35
合計ジャッジ時間 1,171 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
18,848 KB
testcase_01 AC 15 ms
18,740 KB
testcase_02 AC 16 ms
18,692 KB
testcase_03 AC 16 ms
18,872 KB
testcase_04 AC 15 ms
18,792 KB
testcase_05 AC 15 ms
18,892 KB
testcase_06 AC 15 ms
18,904 KB
testcase_07 AC 15 ms
18,792 KB
testcase_08 AC 15 ms
18,868 KB
testcase_09 AC 15 ms
18,740 KB
testcase_10 AC 15 ms
18,848 KB
testcase_11 AC 16 ms
18,784 KB
testcase_12 AC 15 ms
18,860 KB
testcase_13 AC 16 ms
18,780 KB
testcase_14 AC 15 ms
18,856 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php


$line = fgets(STDIN); // 標準入力からの入力値を変数に代入
$array = explode(" ", $line); // 取得した入力値を半角スペースで分解

$i = 1;
foreach ($array as $value) {
    
    if ($i==1){
        $a = intval($value);
    } else {
        $b = intval($value);
    }
    
    $i++;
}

$floor = 0;

// 階層 b の方が大きい場合
if ($a < $b){
    $floor = 1;
// ちょうどぴったり登りきった場合
} elseif ($a%$b == 0){
    $floor = $a / $b + 1;
// その他の場合
} else {
    $floor = floor($a/$b)+1;
    
}




echo $floor;
0