結果
| 問題 | No.2479 Sum of Squares |
| コンテスト | |
| ユーザー |
KDKJ
|
| 提出日時 | 2023-11-29 15:42:42 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 85 ms / 2,000 ms |
| + 321µs | |
| コード長 | 500 bytes |
| 記録 | |
| コンパイル時間 | 242 ms |
| コンパイル使用メモリ | 95,816 KB |
| 実行使用メモリ | 79,744 KB |
| 最終ジャッジ日時 | 2026-09-04 20:42:59 |
| 合計ジャッジ時間 | 4,381 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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