結果

問題 No.2479 Sum of Squares
ユーザー e4q2pfnqe4q2pfnq
提出日時 2023-09-22 22:32:19
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 283 bytes
コンパイル時間 1,406 ms
コンパイル使用メモリ 86,860 KB
実行使用メモリ 79,224 KB
最終ジャッジ日時 2023-09-22 22:32:26
合計ジャッジ時間 4,175 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,436 KB
testcase_01 AC 70 ms
71,320 KB
testcase_02 AC 74 ms
71,404 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 73 ms
71,672 KB
testcase_06 AC 101 ms
71,672 KB
testcase_07 AC 79 ms
71,500 KB
testcase_08 AC 73 ms
71,648 KB
testcase_09 AC 75 ms
71,364 KB
testcase_10 AC 74 ms
71,596 KB
testcase_11 AC 75 ms
71,548 KB
testcase_12 AC 74 ms
71,508 KB
testcase_13 AC 73 ms
71,332 KB
testcase_14 AC 75 ms
71,340 KB
testcase_15 AC 76 ms
71,628 KB
testcase_16 AC 75 ms
71,280 KB
testcase_17 AC 70 ms
71,548 KB
testcase_18 AC 71 ms
71,364 KB
testcase_19 AC 71 ms
71,464 KB
testcase_20 AC 70 ms
71,548 KB
testcase_21 AC 69 ms
71,420 KB
testcase_22 AC 69 ms
71,556 KB
testcase_23 AC 70 ms
71,140 KB
testcase_24 AC 72 ms
71,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = int(input())

T = []
def f(X):
    if X == 0 and len(T) <= 15:
        print(len(T))
        print(*T)
        exit()
    
    if len(T) > 15:
        return
    
    a = int(X**0.5)
    for i in range(a, 0, -1):
        T.append(i*i)
        f(X - i*i)
        T.pop()
    
f(S)
0