結果
| 問題 |
No.2479 Sum of Squares
|
| コンテスト | |
| ユーザー |
KDKJ
|
| 提出日時 | 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, heapify
import sys
from collections import defaultdict, deque
from math import ceil, floor, sqrt, factorial, gcd
from itertools import permutations, combinations
from bisect import bisect_left, bisect_right
sys.setrecursionlimit(10**6)
# input = sys.stdin.readline
s = int(input())
ans = []
while s > 0:
x = s**0.5
if floor(x)**2 > s:
x = floor(x)-1
else:
x = floor(x)
s -= x**2
ans.append(x**2)
print(len(ans))
print(*ans)
KDKJ