結果
| 問題 | No.2479 Sum of Squares |
| コンテスト | |
| ユーザー |
Cecil
|
| 提出日時 | 2023-09-23 12:30:57 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 413 bytes |
| 記録 | |
| コンパイル時間 | 492 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 15,616 KB |
| 最終ジャッジ日時 | 2026-03-31 00:08:18 |
| 合計ジャッジ時間 | 6,937 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)
Cecil