結果
問題 | No.2479 Sum of Squares |
ユーザー |
![]() |
提出日時 | 2023-11-20 15:04:25 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 54 ms / 2,000 ms |
コード長 | 691 bytes |
コンパイル時間 | 406 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 55,808 KB |
最終ジャッジ日時 | 2024-09-26 06:39:12 |
合計ジャッジ時間 | 2,316 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
from collections import *import sysimport heapqimport bisectimport itertoolsfrom functools import lru_cacheimport math# sys.setrecursionlimit(int(1e7))dxdy1 = ((0, 1), (0, -1), (1, 0), (-1, 0))dxdy2 = ((0, 1), (0, -1), (1, 0), (-1, 0), (1, 1), (-1, -1), (1, -1), (-1, 1))dxdy3 = ((0, 1), (1, 0))dxdy4 = ((1, 1), (1, -1), (-1, 1), (-1, -1))INF = float("inf")MOD = 998244353mod = 998244353MOD2 = 10**9 + 7mod2 = 10**9 + 7# memo : len([a,b,...,z])==26input = lambda: sys.stdin.readline().rstrip()mi = lambda: map(int, input().split())li = lambda: list(mi())N = int(input())A = []while N:a = math.isqrt(N)A.append(a**2)N -= a**2print(len(A))print(*A)