結果

問題 No.2479 Sum of Squares
ユーザー e4q2pfnqe4q2pfnq
提出日時 2023-09-22 23:35:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 196 bytes
コンパイル時間 1,117 ms
コンパイル使用メモリ 86,792 KB
実行使用メモリ 72,052 KB
最終ジャッジ日時 2023-09-22 23:36:05
合計ジャッジ時間 3,689 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,704 KB
testcase_01 AC 70 ms
71,768 KB
testcase_02 AC 70 ms
71,696 KB
testcase_03 AC 73 ms
71,824 KB
testcase_04 AC 69 ms
71,644 KB
testcase_05 AC 70 ms
71,840 KB
testcase_06 AC 70 ms
71,600 KB
testcase_07 AC 70 ms
71,752 KB
testcase_08 AC 70 ms
71,800 KB
testcase_09 AC 70 ms
71,452 KB
testcase_10 AC 70 ms
71,764 KB
testcase_11 AC 70 ms
71,916 KB
testcase_12 AC 72 ms
71,828 KB
testcase_13 AC 71 ms
71,712 KB
testcase_14 AC 71 ms
71,848 KB
testcase_15 AC 70 ms
71,848 KB
testcase_16 AC 69 ms
71,820 KB
testcase_17 AC 69 ms
71,428 KB
testcase_18 AC 70 ms
71,692 KB
testcase_19 AC 71 ms
71,704 KB
testcase_20 AC 71 ms
71,892 KB
testcase_21 AC 70 ms
71,988 KB
testcase_22 AC 69 ms
72,052 KB
testcase_23 AC 70 ms
71,704 KB
testcase_24 AC 71 ms
71,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

S = int(input())

ans = []
while S > 0:
    t = math.floor(S**0.5)
    if t**2 > S:
        t -= 1
    a = t ** 2
    
    
    ans.append(a)
    S -= a

print(len(ans))
print(*ans)

0