結果
| 問題 |
No.2510 Six Cube Sum Counting
|
| コンテスト | |
| ユーザー |
ゼット
|
| 提出日時 | 2023-10-23 18:44:52 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 535 bytes |
| コンパイル時間 | 214 ms |
| コンパイル使用メモリ | 82,000 KB |
| 実行使用メモリ | 228,504 KB |
| 最終ジャッジ日時 | 2024-09-22 12:32:34 |
| 合計ジャッジ時間 | 48,979 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 TLE * 1 |
| other | AC * 21 RE * 2 TLE * 3 |
ソースコード
L=[]
N=int(input())
for d in range(0,301):
for e in range(d,301):
for f in range(e,301):
u=d**3+e**3+f**3
if u<N//2:
continue
if u>N:
continue
L.append(u*1000+d)
from bisect import bisect_right
result=0
L.sort()
z=L[-1]
for a in range(0,301):
for b in range(a,301):
for c in range(b,301):
x=N-(a**3+b**3+c**3)
if x>z or x<0:
continue
u=x*1000+c
pos1=bisect_right(L,x*1000+400)
pos2=bisect_right(L,u-1)
result+=pos1-pos2
print(result)
ゼット