結果

問題 No.2479 Sum of Squares
ユーザー 310icecrystal310icecrystal
提出日時 2023-09-23 00:43:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 258 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 82,144 KB
実行使用メモリ 53,568 KB
最終ジャッジ日時 2024-07-16 01:12:36
合計ジャッジ時間 2,052 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

S = int(input())

ans = []
while S:
    OK = 1
    NG = 10**10
    while NG - OK >= 2:
        MID = (OK+NG)//2
        if MID*MID <= S:
            OK = MID
        else:
            NG = MID
    ans.append(OK*OK)
    S -= OK*OK
print(len(ans))
print(*ans)
0