結果

問題 No.800 四平方定理
ユーザー Yoichiro NishimuraYoichiro Nishimura
提出日時 2019-04-26 12:46:00
言語 PHP
(8.3.4)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 295 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 30,888 KB
実行使用メモリ 112,496 KB
最終ジャッジ日時 2024-05-03 06:38:50
合計ジャッジ時間 22,783 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
37,388 KB
testcase_01 AC 76 ms
32,908 KB
testcase_02 AC 63 ms
32,780 KB
testcase_03 AC 67 ms
32,908 KB
testcase_04 AC 63 ms
32,724 KB
testcase_05 AC 65 ms
32,908 KB
testcase_06 AC 81 ms
33,040 KB
testcase_07 AC 72 ms
32,784 KB
testcase_08 AC 82 ms
33,296 KB
testcase_09 AC 74 ms
33,036 KB
testcase_10 AC 1,392 ms
70,260 KB
testcase_11 AC 1,546 ms
70,000 KB
testcase_12 AC 1,613 ms
70,128 KB
testcase_13 AC 1,547 ms
70,128 KB
testcase_14 AC 1,677 ms
70,128 KB
testcase_15 AC 1,590 ms
70,260 KB
testcase_16 AC 1,629 ms
70,128 KB
testcase_17 AC 1,643 ms
70,128 KB
testcase_18 AC 1,637 ms
70,384 KB
testcase_19 AC 1,617 ms
70,000 KB
testcase_20 AC 40 ms
31,140 KB
testcase_21 AC 41 ms
31,072 KB
testcase_22 AC 1,588 ms
70,256 KB
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
list($n, $d) = explode(" ", trim(fgets(STDIN)));
for($x = 1; $x <= $n; $x++){
    for($y = 1; $y <= $n; $y++){
        @$map[$x*$x + $y*$y]++;
    }
}
$count = 0;
for($z = 1; $z <= $n; $z++){
    for($w = 1; $w <= $n; $w++){
        $count+=@$map[$w*$w - $z*$z + $d];
    }
}
echo $count;
0