結果

問題 No.2510 Six Cube Sum Counting
ユーザー 👑 KA37RIKA37RI
提出日時 2023-09-22 19:21:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,827 ms / 4,000 ms
コード長 565 bytes
コンパイル時間 1,176 ms
コンパイル使用メモリ 81,620 KB
実行使用メモリ 387,660 KB
最終ジャッジ日時 2023-10-19 16:32:53
合計ジャッジ時間 81,268 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,542 ms
387,660 KB
testcase_01 AC 2,570 ms
387,660 KB
testcase_02 AC 2,633 ms
387,660 KB
testcase_03 AC 2,558 ms
387,660 KB
testcase_04 AC 2,619 ms
387,660 KB
testcase_05 AC 2,541 ms
387,660 KB
testcase_06 AC 2,586 ms
387,656 KB
testcase_07 AC 2,537 ms
387,660 KB
testcase_08 AC 2,508 ms
387,660 KB
testcase_09 AC 2,544 ms
387,660 KB
testcase_10 AC 2,529 ms
387,660 KB
testcase_11 AC 2,485 ms
387,660 KB
testcase_12 AC 2,498 ms
387,660 KB
testcase_13 AC 2,543 ms
387,660 KB
testcase_14 AC 2,575 ms
387,660 KB
testcase_15 AC 2,532 ms
387,660 KB
testcase_16 AC 2,506 ms
387,660 KB
testcase_17 AC 2,517 ms
387,660 KB
testcase_18 AC 2,529 ms
387,656 KB
testcase_19 AC 2,508 ms
387,660 KB
testcase_20 AC 2,633 ms
387,660 KB
testcase_21 AC 2,636 ms
387,660 KB
testcase_22 AC 2,777 ms
387,660 KB
testcase_23 AC 2,696 ms
387,660 KB
testcase_24 AC 2,713 ms
387,660 KB
testcase_25 AC 2,589 ms
387,660 KB
testcase_26 AC 2,577 ms
387,660 KB
testcase_27 AC 2,645 ms
387,660 KB
testcase_28 AC 2,566 ms
387,660 KB
testcase_29 AC 2,827 ms
387,660 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
			if x not in cubes:
				cubes[x] = 0
			cubes[x] <<= 9
			cubes[x] |= c
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:
				zero = True
				w = cubes[z]
				while w > 0 or zero:
					if w & 0x1ff <= d:
						ans += 1
					w >>= 9
					zero = False
print(ans)
0