結果

問題 No.2479 Sum of Squares
ユーザー timi
提出日時 2023-09-23 10:43:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 82,040 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-07-16 10:13:51
合計ジャッジ時間 2,352 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#N,Q=map(int, input().split())
N=int(input())
ans=[]
while N:
  ok,ng=0,10**10
  for i in range(50):
    mid=(ok+ng)//2 
    if mid**2>N:
      ng=mid
    else:
      ok=mid 
  N-=ok**2 
  ans.append(ok**2)
print(len(ans))
print(*ans)
0