結果

問題 No.800 四平方定理
ユーザー tailstails
提出日時 2020-09-03 18:03:55
言語 Perl
(5.38.2)
結果
AC  
実行時間 1,685 ms / 2,000 ms
コード長 163 bytes
コンパイル時間 538 ms
コンパイル使用メモリ 7,164 KB
実行使用メモリ 96,336 KB
最終ジャッジ日時 2023-08-15 13:04:00
合計ジャッジ時間 24,137 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
6,212 KB
testcase_01 AC 21 ms
7,100 KB
testcase_02 AC 18 ms
6,436 KB
testcase_03 AC 17 ms
6,640 KB
testcase_04 AC 16 ms
6,532 KB
testcase_05 AC 18 ms
6,624 KB
testcase_06 AC 24 ms
7,548 KB
testcase_07 AC 24 ms
6,844 KB
testcase_08 AC 29 ms
7,496 KB
testcase_09 AC 21 ms
6,988 KB
testcase_10 AC 752 ms
55,820 KB
testcase_11 AC 771 ms
57,588 KB
testcase_12 AC 805 ms
57,088 KB
testcase_13 AC 685 ms
56,332 KB
testcase_14 AC 718 ms
57,328 KB
testcase_15 AC 795 ms
57,344 KB
testcase_16 AC 694 ms
57,684 KB
testcase_17 AC 797 ms
57,580 KB
testcase_18 AC 903 ms
57,552 KB
testcase_19 AC 871 ms
57,552 KB
testcase_20 AC 5 ms
5,180 KB
testcase_21 AC 5 ms
5,172 KB
testcase_22 AC 922 ms
57,576 KB
testcase_23 AC 1,679 ms
96,336 KB
testcase_24 AC 1,411 ms
96,208 KB
testcase_25 AC 1,685 ms
96,108 KB
testcase_26 AC 5 ms
5,316 KB
testcase_27 AC 5 ms
5,196 KB
testcase_28 AC 1,448 ms
95,972 KB
testcase_29 AC 1,573 ms
96,148 KB
testcase_30 AC 1,423 ms
96,096 KB
testcase_31 AC 1,277 ms
94,188 KB
testcase_32 AC 1,460 ms
96,172 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

($n,$d)=glob<>;
for$x(1..$n){
	for$y(1..$n){
		++$a[$x*$x+$y*$y];
	}
}
for$w(1..$n){
	for$z(1..$n){
		$e=$w*$w-$z*$z+$d;
		last if $e<0;
		$r+=$a[$e];
	}
}
print$r
0