結果

問題 No.2510 Six Cube Sum Counting
ユーザー 👑 amentorimaruamentorimaru
提出日時 2023-09-21 19:02:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,804 ms / 4,000 ms
コード長 564 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 81,880 KB
実行使用メモリ 440,292 KB
最終ジャッジ日時 2023-10-19 16:29:41
合計ジャッジ時間 55,456 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,752 ms
440,248 KB
testcase_01 AC 1,804 ms
440,248 KB
testcase_02 AC 1,774 ms
440,244 KB
testcase_03 AC 1,758 ms
440,248 KB
testcase_04 AC 1,740 ms
440,256 KB
testcase_05 AC 1,738 ms
440,256 KB
testcase_06 AC 1,731 ms
440,292 KB
testcase_07 AC 1,751 ms
440,248 KB
testcase_08 AC 1,765 ms
440,252 KB
testcase_09 AC 1,721 ms
440,248 KB
testcase_10 AC 1,733 ms
440,248 KB
testcase_11 AC 1,737 ms
440,252 KB
testcase_12 AC 1,712 ms
440,252 KB
testcase_13 AC 1,692 ms
440,252 KB
testcase_14 AC 1,716 ms
440,248 KB
testcase_15 AC 1,737 ms
440,248 KB
testcase_16 AC 1,731 ms
440,248 KB
testcase_17 AC 1,755 ms
440,248 KB
testcase_18 AC 1,742 ms
440,248 KB
testcase_19 AC 1,763 ms
440,248 KB
testcase_20 AC 1,795 ms
440,260 KB
testcase_21 AC 1,746 ms
440,252 KB
testcase_22 AC 1,740 ms
440,244 KB
testcase_23 AC 1,722 ms
440,252 KB
testcase_24 AC 1,697 ms
440,244 KB
testcase_25 AC 1,714 ms
440,252 KB
testcase_26 AC 1,735 ms
440,260 KB
testcase_27 AC 1,675 ms
440,264 KB
testcase_28 AC 1,702 ms
440,248 KB
testcase_29 AC 1,748 ms
440,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

def main():
    n=int(input())
    d=dict()
    ans = 0
    for m0 in range(0,301):
        m03 = m0*m0*m0
        for m1 in range(0,m0+1):
            m13 = m1*m1*m1
            for m2 in range(m1,m0+1):
                m23 = m2*m2*m2
                d[m03+m13+m23]=d.get(m03+m13+m23, 0) + 1
        for m1 in range(m0, 301):
            m13 = m1*m1*m1
            for m2 in range(m1, 301):
                m23 = m2*m2*m2
                ans+=d.get(n-m03-m13-m23, 0)
    print(ans)
    
if __name__ == "__main__":
    main()
0