結果
問題 | No.2479 Sum of Squares |
ユーザー |
![]() |
提出日時 | 2023-09-23 00:21:19 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 44 ms / 2,000 ms |
コード長 | 297 bytes |
コンパイル時間 | 648 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 52,736 KB |
最終ジャッジ日時 | 2024-07-16 00:55:18 |
合計ジャッジ時間 | 2,774 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
import math S = int(input()) A = [] while S > 0: i = 0 while True: k = int(math.floor(pow(S, 0.5))) - i if S - pow(k, 2) >= 0: break else: i += 1 S -= pow(k,2) A.append(pow(k,2)) # print(A,S,k,k**2) print(len(A)) print(*A)