結果

問題 No.2510 Six Cube Sum Counting
ユーザー 👑 seekworserseekworser
提出日時 2023-09-20 14:46:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,281 ms / 4,000 ms
コード長 720 bytes
コンパイル時間 588 ms
コンパイル使用メモリ 81,760 KB
実行使用メモリ 305,168 KB
最終ジャッジ日時 2023-10-19 16:28:51
合計ジャッジ時間 38,769 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,564 KB
testcase_01 AC 39 ms
53,564 KB
testcase_02 AC 1,528 ms
251,700 KB
testcase_03 AC 44 ms
59,840 KB
testcase_04 AC 39 ms
53,564 KB
testcase_05 AC 39 ms
53,564 KB
testcase_06 AC 1,923 ms
305,168 KB
testcase_07 AC 1,905 ms
305,036 KB
testcase_08 AC 1,975 ms
305,140 KB
testcase_09 AC 1,956 ms
305,036 KB
testcase_10 AC 1,879 ms
305,036 KB
testcase_11 AC 1,914 ms
305,040 KB
testcase_12 AC 1,907 ms
305,036 KB
testcase_13 AC 1,928 ms
305,040 KB
testcase_14 AC 2,281 ms
305,036 KB
testcase_15 AC 41 ms
53,564 KB
testcase_16 AC 42 ms
53,564 KB
testcase_17 AC 41 ms
53,564 KB
testcase_18 AC 1,975 ms
305,036 KB
testcase_19 AC 1,941 ms
305,040 KB
testcase_20 AC 668 ms
214,392 KB
testcase_21 AC 1,604 ms
260,280 KB
testcase_22 AC 1,024 ms
253,036 KB
testcase_23 AC 753 ms
228,444 KB
testcase_24 AC 1,480 ms
257,704 KB
testcase_25 AC 1,934 ms
305,044 KB
testcase_26 AC 1,833 ms
303,612 KB
testcase_27 AC 1,697 ms
259,296 KB
testcase_28 AC 1,901 ms
305,040 KB
testcase_29 AC 1,183 ms
258,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x = int(input())
ans = 0
atoc = dict()
for d in range(301):
    cd = d*d*d
    xi = x - cd
    if xi < 0:
        break
    for a in range(d+1):
        ca = a*a*a
        if ca + cd > xi:
            break
        for b in range(a, d+1):
            total = ca + b*b*b + cd
            if total > xi:
                break
            if total in atoc:
                atoc[total] += 1
            else:
                atoc[total] = 1
    for e in range(d, 301):
        ce = e*e*e
        if ce > xi:
            break
        for f in range(e, 301):
            total = ce + f*f*f
            if total > xi:
                break
            if xi - total in atoc:
                ans += atoc[xi - total]
print(ans)
0