結果

問題 No.800 四平方定理
ユーザー Yoichiro NishimuraYoichiro Nishimura
提出日時 2019-04-26 12:48:04
言語 PHP
(8.3.4)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 400 bytes
コンパイル時間 772 ms
コンパイル使用メモリ 30,984 KB
実行使用メモリ 107,116 KB
最終ジャッジ日時 2024-05-03 06:41:24
合計ジャッジ時間 40,884 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
32,012 KB
testcase_01 AC 69 ms
33,036 KB
testcase_02 AC 60 ms
32,908 KB
testcase_03 AC 64 ms
32,652 KB
testcase_04 AC 60 ms
32,780 KB
testcase_05 AC 64 ms
32,908 KB
testcase_06 AC 76 ms
33,164 KB
testcase_07 AC 67 ms
32,912 KB
testcase_08 AC 78 ms
33,164 KB
testcase_09 AC 72 ms
33,036 KB
testcase_10 AC 1,295 ms
69,996 KB
testcase_11 AC 1,464 ms
69,868 KB
testcase_12 AC 1,453 ms
69,996 KB
testcase_13 AC 1,389 ms
70,124 KB
testcase_14 AC 1,478 ms
69,868 KB
testcase_15 AC 1,464 ms
69,872 KB
testcase_16 AC 1,510 ms
70,124 KB
testcase_17 AC 1,501 ms
70,000 KB
testcase_18 AC 1,462 ms
69,868 KB
testcase_19 AC 1,490 ms
69,868 KB
testcase_20 AC 40 ms
31,136 KB
testcase_21 AC 40 ms
31,036 KB
testcase_22 AC 1,463 ms
69,872 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 40 ms
31,212 KB
testcase_27 AC 40 ms
31,208 KB
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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++){
        if(isset($map[$x*$x + $y*$y])){
            $map[$x*$x + $y*$y]++;
        }else{
            $map[$x*$x + $y*$y] = 1;
        }
    }
}
$count = 0;
for($z = 1; $z <= $n; $z++){
    for($w = 1; $w <= $n; $w++){
        $count+=@$map[$w*$w - $z*$z + $d];
    }
}
echo $count;
0