結果
問題 | No.2479 Sum of Squares |
ユーザー |
![]() |
提出日時 | 2023-11-29 15:42:42 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 51 ms / 2,000 ms |
コード長 | 500 bytes |
コンパイル時間 | 517 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 54,912 KB |
最終ジャッジ日時 | 2024-09-26 13:28:43 |
合計ジャッジ時間 | 3,086 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
from heapq import heappush, heappop, heapifyimport sysfrom collections import defaultdict, dequefrom math import ceil, floor, sqrt, factorial, gcdfrom itertools import permutations, combinationsfrom bisect import bisect_left, bisect_rightsys.setrecursionlimit(10**6)# input = sys.stdin.readlines = int(input())ans = []while s > 0:x = s**0.5if floor(x)**2 > s:x = floor(x)-1else:x = floor(x)s -= x**2ans.append(x**2)print(len(ans))print(*ans)