結果
問題 | No.2479 Sum of Squares |
ユーザー |
![]() |
提出日時 | 2023-09-22 21:22:15 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 41 ms / 2,000 ms |
コード長 | 351 bytes |
コンパイル時間 | 371 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 52,480 KB |
最終ジャッジ日時 | 2024-07-08 12:00:33 |
合計ジャッジ時間 | 2,274 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
from math import sqrt, ceildef isqrt(n):yes = 0no = 10 ** 18while no - yes != 1:mid = (yes + no)//2if mid * mid <= n:yes = midelse:no = midreturn yes ** 2S = int(input())ans = []while S:yes = isqrt(S)S -= yesans.append(yes)print(len(ans))print(*ans)