結果

問題 No.2510 Six Cube Sum Counting
ユーザー ゼットゼット
提出日時 2023-10-23 18:44:52
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 535 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 81,816 KB
実行使用メモリ 227,636 KB
最終ジャッジ日時 2023-10-23 18:45:46
合計ジャッジ時間 44,015 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
72,400 KB
testcase_01 AC 122 ms
72,468 KB
testcase_02 TLE -
testcase_03 AC 143 ms
75,676 KB
testcase_04 AC 117 ms
70,360 KB
testcase_05 AC 117 ms
70,360 KB
testcase_06 AC 2,066 ms
83,068 KB
testcase_07 AC 960 ms
75,920 KB
testcase_08 AC 1,588 ms
78,592 KB
testcase_09 AC 1,126 ms
76,284 KB
testcase_10 AC 1,178 ms
76,216 KB
testcase_11 AC 1,236 ms
76,256 KB
testcase_12 AC 1,250 ms
76,604 KB
testcase_13 AC 1,141 ms
76,604 KB
testcase_14 AC 1,212 ms
76,252 KB
testcase_15 AC 136 ms
75,636 KB
testcase_16 AC 135 ms
75,608 KB
testcase_17 AC 116 ms
70,360 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 3,077 ms
195,744 KB
testcase_21 TLE -
testcase_22 TLE -
testcase_23 AC 3,584 ms
212,628 KB
testcase_24 TLE -
testcase_25 AC 1,210 ms
76,336 KB
testcase_26 AC 3,113 ms
103,064 KB
testcase_27 AC 3,714 ms
171,348 KB
testcase_28 AC 1,030 ms
76,216 KB
testcase_29 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0