結果

問題 No.2632 Center of Three Points in Lp Norm
ユーザー NyaanNyaanNyaanNyaan
提出日時 2024-02-16 23:03:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 550 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 66,932 KB
最終ジャッジ日時 2024-02-16 23:04:06
合計ジャッジ時間 44,517 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,097 ms
66,684 KB
testcase_01 AC 1,063 ms
66,872 KB
testcase_02 AC 1,079 ms
66,824 KB
testcase_03 WA -
testcase_04 AC 1,063 ms
66,812 KB
testcase_05 WA -
testcase_06 AC 1,058 ms
66,856 KB
testcase_07 AC 1,117 ms
66,820 KB
testcase_08 AC 1,074 ms
66,872 KB
testcase_09 AC 1,105 ms
66,844 KB
testcase_10 AC 1,075 ms
66,812 KB
testcase_11 WA -
testcase_12 AC 1,071 ms
66,904 KB
testcase_13 AC 1,049 ms
66,840 KB
testcase_14 AC 1,055 ms
66,804 KB
testcase_15 AC 1,093 ms
66,864 KB
testcase_16 AC 1,036 ms
66,916 KB
testcase_17 AC 1,042 ms
66,896 KB
testcase_18 WA -
testcase_19 AC 1,091 ms
66,916 KB
testcase_20 AC 1,066 ms
66,904 KB
testcase_21 AC 1,073 ms
66,804 KB
testcase_22 WA -
testcase_23 AC 1,056 ms
66,904 KB
testcase_24 AC 1,070 ms
66,824 KB
testcase_25 AC 1,071 ms
66,896 KB
testcase_26 AC 1,055 ms
66,860 KB
testcase_27 WA -
testcase_28 AC 1,049 ms
66,884 KB
testcase_29 AC 1,064 ms
66,828 KB
testcase_30 AC 1,068 ms
66,828 KB
testcase_31 WA -
testcase_32 AC 1,111 ms
66,884 KB
testcase_33 WA -
testcase_34 AC 1,033 ms
66,904 KB
testcase_35 AC 1,094 ms
66,904 KB
testcase_36 AC 1,098 ms
66,872 KB
testcase_37 AC 1,094 ms
66,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
import scipy

p = float(input())
ax, ay = map(float, input().split())
bx, by = map(float, input().split())
cx, cy = map(float, input().split())


def my_pow(x):
    return np.abs(x) ** p


def f(point):
    x, y = point
    # print(x, y)
    anorm = my_pow(ax - x) + my_pow(ay - y)
    bnorm = my_pow(bx - x) + my_pow(by - y)
    cnorm = my_pow(cx - x) + my_pow(cy - y)
    return max(anorm, bnorm, cnorm) - min(anorm, bnorm, cnorm)


ans = scipy.optimize.fmin(f, [-100000, 100000], disp=False, maxiter=500, ftol=1e-9)
print(*ans)
0