結果
問題 | No.2632 Center of Three Points in Lp Norm |
ユーザー | NyaanNyaan |
提出日時 | 2024-02-16 23:26:08 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,119 bytes |
コンパイル時間 | 116 ms |
コンパイル使用メモリ | 12,032 KB |
実行使用メモリ | 67,676 KB |
最終ジャッジ日時 | 2024-02-16 23:27:33 |
合計ジャッジ時間 | 81,859 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1,959 ms
66,940 KB |
testcase_01 | AC | 1,952 ms
67,676 KB |
testcase_02 | AC | 1,973 ms
66,956 KB |
testcase_03 | AC | 1,997 ms
66,936 KB |
testcase_04 | AC | 1,986 ms
66,928 KB |
testcase_05 | AC | 1,997 ms
66,932 KB |
testcase_06 | AC | 1,953 ms
66,968 KB |
testcase_07 | TLE | - |
testcase_08 | AC | 1,985 ms
66,972 KB |
testcase_09 | AC | 1,987 ms
66,956 KB |
testcase_10 | AC | 1,982 ms
66,944 KB |
testcase_11 | WA | - |
testcase_12 | AC | 1,979 ms
66,892 KB |
testcase_13 | WA | - |
testcase_14 | TLE | - |
testcase_15 | AC | 1,945 ms
66,956 KB |
testcase_16 | TLE | - |
testcase_17 | AC | 1,948 ms
66,896 KB |
testcase_18 | AC | 1,992 ms
66,904 KB |
testcase_19 | AC | 1,973 ms
66,896 KB |
testcase_20 | AC | 1,932 ms
66,904 KB |
testcase_21 | AC | 1,972 ms
66,928 KB |
testcase_22 | WA | - |
testcase_23 | AC | 1,945 ms
66,892 KB |
testcase_24 | TLE | - |
testcase_25 | AC | 1,966 ms
66,904 KB |
testcase_26 | AC | 1,923 ms
66,956 KB |
testcase_27 | AC | 1,953 ms
66,936 KB |
testcase_28 | AC | 1,950 ms
66,892 KB |
testcase_29 | AC | 1,933 ms
66,924 KB |
testcase_30 | AC | 1,959 ms
66,940 KB |
testcase_31 | AC | 1,950 ms
66,888 KB |
testcase_32 | AC | 1,980 ms
66,916 KB |
testcase_33 | AC | 1,985 ms
66,928 KB |
testcase_34 | AC | 1,993 ms
66,904 KB |
testcase_35 | AC | 1,955 ms
66,904 KB |
testcase_36 | AC | 1,939 ms
66,972 KB |
testcase_37 | TLE | - |
ソースコード
import numpy as np import scipy import time import random p = float(input()) ax, ay = map(float, input().split()) bx, by = map(float, input().split()) cx, cy = map(float, input().split()) dx = (ax + bx + cx) / 3 dy = (ay + by + cy) / 3 def my_pow(x): return np.abs(x) ** p def f(point): x, y = point 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) start = time.time() ans = [] best = 1e9 def check(X, Y): global ans, best cur = scipy.optimize.fmin(f, [X, Y], disp=False, maxiter=500, ftol=1e-12) if f(cur) < best: ans = cur best = f(cur) for scale in range(5, 7): for X in [-(10**scale), 10**scale]: for Y in [-(10**scale), 10**scale]: check(X, Y) check(X + dx, Y + dy) while time.time() - start < 1.4: scale = random.randint(1, 6) X = random.randint(-(10**scale), 10**scale) Y = random.randint(-(10**scale), 10**scale) check(X, Y) check(X + dx, Y + dy) print(*ans)