結果

問題 No.2510 Six Cube Sum Counting
ユーザー 👑 KA37RIKA37RI
提出日時 2023-09-22 19:12:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 553 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 81,884 KB
実行使用メモリ 392,580 KB
最終ジャッジ日時 2023-10-19 16:31:20
合計ジャッジ時間 84,695 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,647 ms
392,580 KB
testcase_01 AC 2,683 ms
392,580 KB
testcase_02 AC 2,910 ms
392,580 KB
testcase_03 AC 2,657 ms
392,580 KB
testcase_04 WA -
testcase_05 AC 2,636 ms
392,580 KB
testcase_06 AC 2,663 ms
392,580 KB
testcase_07 AC 2,685 ms
392,580 KB
testcase_08 AC 2,696 ms
392,580 KB
testcase_09 AC 2,645 ms
392,580 KB
testcase_10 AC 2,674 ms
392,580 KB
testcase_11 AC 2,639 ms
392,580 KB
testcase_12 AC 2,638 ms
392,580 KB
testcase_13 AC 2,633 ms
392,580 KB
testcase_14 AC 2,659 ms
392,580 KB
testcase_15 AC 2,641 ms
392,580 KB
testcase_16 AC 2,701 ms
392,580 KB
testcase_17 AC 2,606 ms
392,580 KB
testcase_18 AC 2,643 ms
392,580 KB
testcase_19 AC 2,647 ms
392,580 KB
testcase_20 AC 2,728 ms
392,580 KB
testcase_21 AC 2,727 ms
392,580 KB
testcase_22 WA -
testcase_23 AC 2,777 ms
392,580 KB
testcase_24 AC 2,802 ms
392,580 KB
testcase_25 AC 2,702 ms
392,580 KB
testcase_26 AC 2,697 ms
392,580 KB
testcase_27 AC 2,736 ms
392,580 KB
testcase_28 AC 2,730 ms
392,580 KB
testcase_29 AC 2,860 ms
392,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ans = 0
cubes = {}
for a in range(301):
	a3 = a * a * a
	for b in range(a, 301):
		b3 = b * b * b
		for c in range(b, 301):
			c3 = c * c * c
			x = a3 + b3 + c3
			y = (a << 18) | (b << 9) | c
			if x not in cubes:
				cubes[x] = 0
			cubes[x] <<= 27
			cubes[x] |= y
for d in range(301):
	d3 = d * d * d
	for e in range(d, 301):
		e3 = e * e * e
		for f in range(e, 301):
			f3 = f * f * f
			x = d3 + e3 + f3
			z = n - x
			if z in cubes:
				w = cubes[z]
				while w:
					if w & 0x1ff <= d:
						ans += 1
					w >>= 27
print(ans)
0