結果

問題 No.2632 Center of Three Points in Lp Norm
ユーザー maspymaspy
提出日時 2024-02-16 23:31:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 455 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 69,408 KB
最終ジャッジ日時 2024-02-16 23:32:34
合計ジャッジ時間 52,488 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,244 ms
69,392 KB
testcase_01 AC 1,236 ms
69,388 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 1,215 ms
69,388 KB
testcase_05 WA -
testcase_06 AC 1,226 ms
69,388 KB
testcase_07 WA -
testcase_08 AC 1,227 ms
69,392 KB
testcase_09 WA -
testcase_10 AC 1,232 ms
69,392 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 1,218 ms
69,392 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 1,233 ms
69,388 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 1,218 ms
69,388 KB
testcase_25 AC 1,221 ms
69,388 KB
testcase_26 WA -
testcase_27 AC 1,225 ms
69,388 KB
testcase_28 WA -
testcase_29 AC 1,226 ms
69,392 KB
testcase_30 AC 1,227 ms
69,392 KB
testcase_31 AC 1,235 ms
69,392 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 1,235 ms
69,388 KB
testcase_35 WA -
testcase_36 AC 1,199 ms
67,300 KB
testcase_37 AC 1,184 ms
69,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import scipy
from scipy import optimize

p = float(input())
x1, y1 = map(float, input().split())
x2, y2 = map(float, input().split())
x3, y3 = map(float, input().split())

def f(point):
    x, y = point
    d1 = abs(x1 - x) ** p + abs(y1 - y) ** p
    d2 = abs(x2 - x) ** p + abs(y2 - y) ** p
    d3 = abs(x3 - x) ** p + abs(y3 - y) ** p
    return (d2 - d1) ** 2 + (d3 - d1) ** 2 + (d3 - d2) ** 2

x_min = optimize.minimize(f, x0=[0, 0])
print(*x_min.x)
0