結果
問題 |
No.2479 Sum of Squares
|
ユーザー |
![]() |
提出日時 | 2023-09-23 12:31:39 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 414 bytes |
コンパイル時間 | 77 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-16 12:08:58 |
合計ジャッジ時間 | 4,315 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 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)