結果

問題 No.1205 Eye Drops
ユーザー hiramarihiramari
提出日時 2020-11-30 23:04:33
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 596 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 18,704 KB
実行使用メモリ 19,164 KB
最終ジャッジ日時 2023-10-11 03:08:48
合計ジャッジ時間 27,653 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
18,924 KB
testcase_01 WA -
testcase_02 AC 166 ms
18,940 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 428 ms
18,688 KB
testcase_12 WA -
testcase_13 AC 253 ms
18,896 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 423 ms
18,988 KB
testcase_17 WA -
testcase_18 AC 824 ms
18,976 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 196 ms
18,888 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 1,069 ms
18,868 KB
testcase_38 AC 15 ms
18,932 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
    list($M,$P,$T) = explode(" ", trim(fgets(STDIN)));
    $position = 0;
    $ans = true;
    $arr_P = array($P);
    $arr_T = array($T);
    
    for($i=0;$i<$M;$i++){
        //時刻Tに区画Pの+-Tの範囲にいる場合
        if ($arr_P[$i] - $arr_T[$i] <= $position or  $position <= $arr_P[$i] + $arr_T[$i]){
            //成功時、$Pへ移動する
            $position = $arr_P[$i];
        }else{
            //失敗
            $ans = false;
            break;
        }
    }
    
    if ($ans == true){
        printf("Yes");
    } else {
        printf("No");
    }
0