結果
問題 | No.2479 Sum of Squares |
ユーザー |
![]() |
提出日時 | 2023-09-22 21:23:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 49 ms / 2,000 ms |
コード長 | 681 bytes |
コンパイル時間 | 158 ms |
コンパイル使用メモリ | 82,320 KB |
実行使用メモリ | 54,784 KB |
最終ジャッジ日時 | 2024-07-08 12:03:12 |
合計ジャッジ時間 | 2,445 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#############################################################import syssys.setrecursionlimit(10**7)from heapq import heappop,heappushfrom collections import deque,defaultdict,Counterfrom bisect import bisect_left, bisect_rightfrom itertools import product,combinations,permutationsipt = sys.stdin.readlinedef iin():return int(ipt())def lmin():return list(map(int,ipt().split()))MOD = 998244353#############################################################S = iin()ans = []while S:t = int(S**0.5)for i in range(t+2,t-3,-1):if i**2 <= S:ans.append(i**2)S -= i**2breakprint(len(ans))print(*ans)