結果
| 問題 | 
                            No.2479 Sum of Squares
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-09-22 22:25:39 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 38 ms / 2,000 ms | 
| コード長 | 298 bytes | 
| コンパイル時間 | 153 ms | 
| コンパイル使用メモリ | 82,276 KB | 
| 実行使用メモリ | 52,480 KB | 
| 最終ジャッジ日時 | 2024-07-08 13:10:39 | 
| 合計ジャッジ時間 | 1,901 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 22 | 
ソースコード
ss = int(input())
s = ss
ans = []
z = 4**70
while s >= 10**17:
    while s >= z:
        s -= z
        ans.append(z)
    z //= 4
    
import math
while s >= 1:
    x = math.floor(math.sqrt(s))
    ans.append(x**2)
    s -= x**2
while sum(ans) != ss:
    ans.append(1)
print(len(ans))
print(*ans)