結果
問題 | No.2479 Sum of Squares |
ユーザー |
![]() |
提出日時 | 2023-09-23 12:30:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 413 bytes |
コンパイル時間 | 240 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-16 12:08:19 |
合計ジャッジ時間 | 6,154 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 22 |
ソースコード
def binary_search(num): l = 0 r = num mid = (l+r)//2 if num == 1: return 1 while r-l > 0: mid = (l+r)//2 print(l,r,mid) if mid*mid < num: return mid else: r = mid s = int(input()) ans = list() while True: if s == 0: break num = binary_search(s) ans.append(num*num) s -= num*num print(len(ans)) print(*ans)