結果

問題 No.800 四平方定理
ユーザー 👑 tatt61880tatt61880
提出日時 2019-03-17 23:41:15
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 499 bytes
コンパイル時間 2,287 ms
コンパイル使用メモリ 158,700 KB
実行使用メモリ 128,740 KB
最終ジャッジ日時 2023-10-14 15:26:16
合計ジャッジ時間 7,256 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
128,540 KB
testcase_01 AC 36 ms
128,436 KB
testcase_02 AC 35 ms
128,456 KB
testcase_03 AC 36 ms
128,432 KB
testcase_04 AC 36 ms
128,548 KB
testcase_05 AC 36 ms
128,480 KB
testcase_06 AC 36 ms
128,636 KB
testcase_07 AC 36 ms
128,564 KB
testcase_08 AC 37 ms
128,492 KB
testcase_09 AC 36 ms
128,648 KB
testcase_10 AC 70 ms
128,568 KB
testcase_11 AC 72 ms
128,576 KB
testcase_12 AC 75 ms
128,392 KB
testcase_13 AC 68 ms
128,600 KB
testcase_14 AC 71 ms
128,320 KB
testcase_15 AC 74 ms
128,596 KB
testcase_16 AC 70 ms
128,432 KB
testcase_17 AC 71 ms
128,500 KB
testcase_18 AC 76 ms
128,388 KB
testcase_19 AC 77 ms
128,596 KB
testcase_20 AC 35 ms
128,396 KB
testcase_21 AC 35 ms
128,600 KB
testcase_22 AC 79 ms
128,428 KB
testcase_23 AC 125 ms
128,528 KB
testcase_24 AC 111 ms
128,424 KB
testcase_25 AC 120 ms
128,740 KB
testcase_26 AC 36 ms
128,456 KB
testcase_27 AC 35 ms
128,564 KB
testcase_28 AC 112 ms
128,432 KB
testcase_29 AC 116 ms
128,512 KB
testcase_30 AC 111 ms
128,596 KB
testcase_31 AC 109 ms
128,436 KB
testcase_32 AC 112 ms
128,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var _: [][]char :: cui@input().split(" ")
	var N: int :: _[0].toInt(&)
	var D: int :: _[1].toInt(&)
	var xy: []int :: #[2 * 2000 ^ 2 + 1]int
	var zwD: []int :: #[2 * 2000 ^ 2 + 1]int
	for x(1, N)
		for y(1, N)
			do xy[x ^ 2 + y ^ 2] :+ 1
		end for
	end for
	for z(1, N)
		for w(1, N)
			var v: int :: w ^ 2 - z ^ 2 + D
			if(v > 0)
				do zwD[v] :+ 1
			end if
		end for
	end for
	var ans: int
	for i(1, 2 * N ^ 2)
		do ans :+ xy[i] * zwD[i]
	end for
	do cui@print("\{ans}\n")
end func
0