結果
| 問題 | No.2479 Sum of Squares |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-22 22:25:39 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 63 ms / 2,000 ms |
| + 488µs | |
| コード長 | 298 bytes |
| 記録 | |
| コンパイル時間 | 228 ms |
| コンパイル使用メモリ | 95,848 KB |
| 実行使用メモリ | 79,104 KB |
| 最終ジャッジ日時 | 2026-08-12 19:45:59 |
| 合計ジャッジ時間 | 3,480 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)