結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
18,852 KB
testcase_01 WA -
testcase_02 AC 125 ms
19,020 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 296 ms
18,972 KB
testcase_12 WA -
testcase_13 AC 173 ms
19,020 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 296 ms
18,996 KB
testcase_17 WA -
testcase_18 AC 544 ms
19,020 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 166 ms
18,996 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 754 ms
18,808 KB
testcase_38 AC 15 ms
18,988 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);
    
    for($i=0;$i<$M;$i++){
        //時刻Tに区画Pの+ー1の範囲にいる場合
        if ($arr_P[$i] - $T <= $position or  $position <= $arr_P[$i] + $T){
            //成功時、$Pへ移動する
            $position = $arr_P[$i];
        }else{
            //失敗
            $ans = false;
            break;
        }
    }
    if ($ans == true){
        printf("Yes");
    } else {
        printf("No");
    }
    
0