結果

問題 No.800 四平方定理
ユーザー tailstails
提出日時 2020-09-03 18:07:59
言語 Perl
(5.38.2)
結果
AC  
実行時間 1,467 ms / 2,000 ms
コード長 181 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 5,888 KB
実行使用メモリ 107,136 KB
最終ジャッジ日時 2024-05-03 00:36:09
合計ジャッジ時間 18,911 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,168 KB
testcase_01 AC 22 ms
7,936 KB
testcase_02 AC 19 ms
7,296 KB
testcase_03 AC 19 ms
7,552 KB
testcase_04 AC 18 ms
7,424 KB
testcase_05 AC 19 ms
7,552 KB
testcase_06 AC 23 ms
8,320 KB
testcase_07 AC 26 ms
7,680 KB
testcase_08 AC 31 ms
8,448 KB
testcase_09 AC 22 ms
7,808 KB
testcase_10 AC 687 ms
55,168 KB
testcase_11 AC 648 ms
57,216 KB
testcase_12 AC 719 ms
56,704 KB
testcase_13 AC 582 ms
55,808 KB
testcase_14 AC 581 ms
57,088 KB
testcase_15 AC 725 ms
56,960 KB
testcase_16 AC 576 ms
57,216 KB
testcase_17 AC 602 ms
56,960 KB
testcase_18 AC 808 ms
57,088 KB
testcase_19 AC 780 ms
57,088 KB
testcase_20 AC 7 ms
5,888 KB
testcase_21 AC 7 ms
6,016 KB
testcase_22 AC 850 ms
57,088 KB
testcase_23 AC 1,463 ms
107,008 KB
testcase_24 AC 1,094 ms
107,132 KB
testcase_25 AC 1,467 ms
107,136 KB
testcase_26 AC 8 ms
5,888 KB
testcase_27 AC 7 ms
5,888 KB
testcase_28 AC 1,085 ms
106,880 KB
testcase_29 AC 1,245 ms
107,116 KB
testcase_30 AC 1,125 ms
107,008 KB
testcase_31 AC 1,011 ms
92,824 KB
testcase_32 AC 1,224 ms
107,008 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

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