結果

問題 No.2510 Six Cube Sum Counting
ユーザー titiatitia
提出日時 2023-10-26 01:02:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 783 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 81,872 KB
実行使用メモリ 246,400 KB
最終ジャッジ日時 2023-10-26 01:02:59
合計ジャッジ時間 41,062 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
64,224 KB
testcase_01 AC 80 ms
66,356 KB
testcase_02 WA -
testcase_03 AC 94 ms
70,728 KB
testcase_04 WA -
testcase_05 AC 78 ms
64,224 KB
testcase_06 WA -
testcase_07 AC 1,513 ms
238,656 KB
testcase_08 AC 1,622 ms
238,656 KB
testcase_09 AC 1,522 ms
238,656 KB
testcase_10 AC 1,594 ms
238,656 KB
testcase_11 AC 1,563 ms
238,656 KB
testcase_12 AC 1,532 ms
238,656 KB
testcase_13 AC 1,558 ms
238,656 KB
testcase_14 AC 1,594 ms
238,656 KB
testcase_15 AC 87 ms
68,480 KB
testcase_16 AC 85 ms
68,488 KB
testcase_17 AC 75 ms
64,224 KB
testcase_18 AC 1,509 ms
238,656 KB
testcase_19 AC 1,502 ms
238,656 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 1,566 ms
238,656 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 1,507 ms
238,656 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

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 and c<=d:
            ANS+=1
        else:
            break

print(ANS)

                    

                    
                    
            
0