結果

問題 No.48 ロボットの操縦
ユーザー tazakkytazakky
提出日時 2017-08-31 20:24:03
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 432 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 30,556 KB
実行使用メモリ 30,936 KB
最終ジャッジ日時 2024-04-24 09:18:21
合計ジャッジ時間 1,859 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
30,416 KB
testcase_01 AC 36 ms
30,612 KB
testcase_02 AC 35 ms
30,712 KB
testcase_03 WA -
testcase_04 AC 38 ms
30,716 KB
testcase_05 AC 34 ms
30,428 KB
testcase_06 AC 34 ms
30,760 KB
testcase_07 AC 36 ms
30,544 KB
testcase_08 WA -
testcase_09 AC 37 ms
30,700 KB
testcase_10 WA -
testcase_11 AC 34 ms
30,676 KB
testcase_12 AC 37 ms
30,612 KB
testcase_13 AC 36 ms
30,824 KB
testcase_14 AC 38 ms
30,528 KB
testcase_15 AC 35 ms
30,428 KB
testcase_16 AC 38 ms
30,560 KB
testcase_17 AC 36 ms
30,516 KB
testcase_18 WA -
testcase_19 AC 36 ms
30,676 KB
testcase_20 AC 38 ms
30,532 KB
testcase_21 AC 34 ms
30,888 KB
testcase_22 WA -
testcase_23 AC 35 ms
30,660 KB
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
    $x = trim(fgets(STDIN));
    $y = trim(fgets(STDIN));
    $l = trim(fgets(STDIN));
    
    $count = 0;
    
    //南北の方向
    if($y > 0){
        $count = ceil(abs($y) / $l);
        //echo $count."\n";
    }elseif($y < 0){
        $count = 2 + ceil(abs($y) / $l);
        //echo $count."\n";
    }
    
    //東西
    if($x != 0){
    $count = $count + 1 + ceil(abs($x) / $l);  
    }
    
    echo $count;
?>
0