結果

問題 No.240 ナイト散歩
ユーザー papinianuspapinianus
提出日時 2016-09-23 09:07:27
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 564 bytes
コンパイル時間 1,832 ms
コンパイル使用メモリ 30,468 KB
実行使用メモリ 32,656 KB
最終ジャッジ日時 2024-04-28 21:23:00
合計ジャッジ時間 6,721 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 99 ms
32,268 KB
testcase_03 WA -
testcase_04 AC 99 ms
32,400 KB
testcase_05 AC 102 ms
32,396 KB
testcase_06 AC 101 ms
32,400 KB
testcase_07 AC 99 ms
32,396 KB
testcase_08 AC 100 ms
32,400 KB
testcase_09 AC 101 ms
32,524 KB
testcase_10 AC 101 ms
32,528 KB
testcase_11 AC 100 ms
32,656 KB
testcase_12 AC 101 ms
32,528 KB
testcase_13 AC 100 ms
32,400 KB
testcase_14 AC 103 ms
32,336 KB
testcase_15 AC 102 ms
32,140 KB
testcase_16 AC 100 ms
32,140 KB
testcase_17 AC 102 ms
32,396 KB
testcase_18 AC 99 ms
32,524 KB
testcase_19 AC 99 ms
32,524 KB
testcase_20 AC 101 ms
32,396 KB
testcase_21 AC 100 ms
32,528 KB
testcase_22 AC 101 ms
32,396 KB
testcase_23 AC 103 ms
32,528 KB
testcase_24 AC 99 ms
32,268 KB
testcase_25 AC 102 ms
32,396 KB
testcase_26 AC 101 ms
32,524 KB
testcase_27 AC 101 ms
32,272 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 100 ms
32,400 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$directions = [[-2,-1],[-2,1],[-1,-2],[-1,2],[1,-2],[1,2],[2,-1],[2,1],];
$pos = [0=>[0=>1]];
for($i = 3;$i;$i--)
{
    for($j = count($pos); $j ;$j--)
    {
        foreach($pos as $x => $ys)
        {
            foreach($ys as $y => $flg)
            {
                foreach($directions as $dir)
                {
                    $pos[$x+$dir[0]][$y+$dir[1]] = 1;
                }
            }
        }
    }
}
list($qx , $qy) = explode(" ", trim(fgets(STDIN)));
if(isset($pos[$qx][$qy]))
{
    echo "YES";
}
else {
    echo "NO";
}
echo PHP_EOL;
0