結果

問題 No.240 ナイト散歩
ユーザー papinianuspapinianus
提出日時 2016-09-23 09:14:34
言語 PHP
(8.3.4)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 517 bytes
コンパイル時間 1,212 ms
コンパイル使用メモリ 30,632 KB
実行使用メモリ 31,124 KB
最終ジャッジ日時 2024-04-16 19:43:50
合計ジャッジ時間 2,508 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
30,816 KB
testcase_01 AC 43 ms
30,980 KB
testcase_02 AC 44 ms
30,624 KB
testcase_03 AC 44 ms
30,868 KB
testcase_04 AC 42 ms
30,652 KB
testcase_05 AC 41 ms
30,728 KB
testcase_06 AC 41 ms
30,756 KB
testcase_07 AC 41 ms
30,852 KB
testcase_08 AC 41 ms
30,764 KB
testcase_09 AC 40 ms
30,476 KB
testcase_10 AC 41 ms
30,992 KB
testcase_11 AC 41 ms
30,644 KB
testcase_12 AC 41 ms
31,020 KB
testcase_13 AC 41 ms
30,980 KB
testcase_14 AC 41 ms
30,812 KB
testcase_15 AC 41 ms
30,712 KB
testcase_16 AC 41 ms
30,640 KB
testcase_17 AC 41 ms
30,868 KB
testcase_18 AC 41 ms
30,948 KB
testcase_19 AC 41 ms
30,924 KB
testcase_20 AC 41 ms
30,816 KB
testcase_21 AC 41 ms
30,792 KB
testcase_22 AC 41 ms
30,724 KB
testcase_23 AC 41 ms
30,844 KB
testcase_24 AC 43 ms
30,740 KB
testcase_25 AC 41 ms
31,124 KB
testcase_26 AC 41 ms
30,596 KB
testcase_27 AC 41 ms
30,628 KB
testcase_28 AC 41 ms
30,824 KB
testcase_29 AC 41 ms
30,816 KB
testcase_30 AC 41 ms
30,952 KB
testcase_31 AC 41 ms
31,004 KB
testcase_32 AC 41 ms
30,700 KB
testcase_33 AC 42 ms
30,824 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--)
{
        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