結果

問題 No.2510 Six Cube Sum Counting
ユーザー titiatitia
提出日時 2023-10-26 01:04:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 720 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 81,832 KB
実行使用メモリ 244,484 KB
最終ジャッジ日時 2023-10-26 01:05:21
合計ジャッジ時間 40,645 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
64,068 KB
testcase_01 AC 77 ms
66,200 KB
testcase_02 AC 2,274 ms
238,692 KB
testcase_03 AC 90 ms
70,580 KB
testcase_04 WA -
testcase_05 AC 74 ms
64,068 KB
testcase_06 AC 1,725 ms
238,540 KB
testcase_07 AC 1,463 ms
238,552 KB
testcase_08 AC 1,578 ms
238,552 KB
testcase_09 AC 1,470 ms
238,552 KB
testcase_10 AC 1,508 ms
238,552 KB
testcase_11 AC 1,494 ms
238,552 KB
testcase_12 AC 1,505 ms
238,552 KB
testcase_13 AC 1,483 ms
238,552 KB
testcase_14 AC 1,487 ms
238,552 KB
testcase_15 AC 82 ms
68,336 KB
testcase_16 AC 84 ms
68,344 KB
testcase_17 AC 74 ms
64,080 KB
testcase_18 AC 1,392 ms
238,552 KB
testcase_19 AC 1,437 ms
238,552 KB
testcase_20 AC 1,536 ms
240,664 KB
testcase_21 AC 2,202 ms
238,552 KB
testcase_22 AC 2,056 ms
240,664 KB
testcase_23 AC 1,756 ms
240,472 KB
testcase_24 AC 2,251 ms
244,484 KB
testcase_25 AC 1,496 ms
238,616 KB
testcase_26 AC 1,994 ms
238,548 KB
testcase_27 AC 2,242 ms
238,592 KB
testcase_28 AC 1,479 ms
238,592 KB
testcase_29 AC 2,198 ms
242,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

from bisect import bisect

X=int(input())

D=dict()
ANS=0
LIST=[]
for a in range(301):
    for b in range(a,301):
        for c in range(b,301):
            S=a**3+b**3+c**3
            if S>X:
                continue
            LIST.append(S*(302*302)+a*302+c)

LIST.sort()

for p in LIST:
    c=p%302
    p//=302
    a=p%302
    S=p//302
    
    if S>X:
        continue

    k=X-S

    x=bisect(LIST,k*(302*302))

    for i in range(x,10**9):
        if i==len(LIST):
            break

        y=LIST[i]
        f=y%302
        y//=302
        d=y%302
        l=y//302

        if k==l:
            if c<=d:
                ANS+=1
        else:
            break

print(ANS)
0