結果
| 問題 | No.2479 Sum of Squares |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-22 22:25:39 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 2,000 ms |
| コード長 | 298 bytes |
| 記録 | |
| コンパイル時間 | 142 ms |
| コンパイル使用メモリ | 85,180 KB |
| 実行使用メモリ | 52,744 KB |
| 最終ジャッジ日時 | 2026-03-30 07:11:59 |
| 合計ジャッジ時間 | 1,681 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)