結果
問題 | No.2479 Sum of Squares |
ユーザー |
![]() |
提出日時 | 2023-09-23 16:33:24 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 34 ms / 2,000 ms |
コード長 | 434 bytes |
コンパイル時間 | 103 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,392 KB |
最終ジャッジ日時 | 2024-07-16 16:25:44 |
合計ジャッジ時間 | 1,973 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
from decimal import Decimalimport mathimport bisectdef binary_search(num):l = 1r = 10**9+1mid = (l+r)//2while r-l > 1:mid = (l+r)//2if mid*mid <= num:l = midelse:r = midreturn ls = int(input())ans = list()while True:if s == 0:breaknum = binary_search(s)ans.append(num*num)s -= num*numprint(len(ans))print(*ans)