結果

問題 No.2510 Six Cube Sum Counting
ユーザー titiatitia
提出日時 2023-10-26 01:07:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,244 ms / 4,000 ms
コード長 722 bytes
コンパイル時間 851 ms
コンパイル使用メモリ 81,820 KB
実行使用メモリ 246,372 KB
最終ジャッジ日時 2023-10-26 01:08:31
合計ジャッジ時間 39,830 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
64,196 KB
testcase_01 AC 76 ms
66,328 KB
testcase_02 AC 2,244 ms
240,672 KB
testcase_03 AC 88 ms
70,708 KB
testcase_04 AC 73 ms
64,196 KB
testcase_05 AC 74 ms
64,196 KB
testcase_06 AC 1,721 ms
238,628 KB
testcase_07 AC 1,428 ms
238,628 KB
testcase_08 AC 1,557 ms
238,628 KB
testcase_09 AC 1,433 ms
238,628 KB
testcase_10 AC 1,493 ms
238,628 KB
testcase_11 AC 1,464 ms
238,628 KB
testcase_12 AC 1,480 ms
238,628 KB
testcase_13 AC 1,463 ms
238,628 KB
testcase_14 AC 1,467 ms
238,628 KB
testcase_15 AC 83 ms
68,452 KB
testcase_16 AC 90 ms
68,460 KB
testcase_17 AC 73 ms
64,196 KB
testcase_18 AC 1,431 ms
238,628 KB
testcase_19 AC 1,455 ms
238,628 KB
testcase_20 AC 1,513 ms
240,672 KB
testcase_21 AC 2,211 ms
238,628 KB
testcase_22 AC 2,072 ms
240,672 KB
testcase_23 AC 1,745 ms
240,672 KB
testcase_24 AC 2,184 ms
246,372 KB
testcase_25 AC 1,487 ms
238,628 KB
testcase_26 AC 1,993 ms
238,628 KB
testcase_27 AC 2,207 ms
238,628 KB
testcase_28 AC 1,471 ms
238,628 KB
testcase_29 AC 2,166 ms
242,420 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)-1)

    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