結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー akitsugu777akitsugu777
提出日時 2019-08-21 16:26:45
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 614 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 11,020 KB
実行使用メモリ 8,584 KB
最終ジャッジ日時 2023-07-30 10:24:13
合計ジャッジ時間 2,070 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,452 KB
testcase_01 AC 16 ms
8,412 KB
testcase_02 AC 16 ms
8,444 KB
testcase_03 AC 15 ms
8,448 KB
testcase_04 AC 16 ms
8,548 KB
testcase_05 AC 16 ms
8,448 KB
testcase_06 AC 16 ms
8,524 KB
testcase_07 AC 16 ms
8,452 KB
testcase_08 AC 16 ms
8,404 KB
testcase_09 AC 16 ms
8,500 KB
testcase_10 AC 16 ms
8,412 KB
testcase_11 AC 16 ms
8,496 KB
testcase_12 AC 16 ms
8,540 KB
testcase_13 AC 16 ms
8,584 KB
testcase_14 AC 16 ms
8,580 KB
testcase_15 AC 16 ms
8,400 KB
testcase_16 AC 15 ms
8,448 KB
testcase_17 AC 16 ms
8,396 KB
testcase_18 AC 15 ms
8,444 KB
testcase_19 AC 16 ms
8,468 KB
testcase_20 AC 16 ms
8,448 KB
testcase_21 AC 16 ms
8,492 KB
testcase_22 AC 16 ms
8,460 KB
testcase_23 AC 16 ms
8,496 KB
testcase_24 AC 16 ms
8,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, c, d, e, f = map(int,input().split())
p1 = [a, b]
p2 = [c, d]
p3 = [e, f]

def f(x, y):
    z = ((y[0]-x[0])**2 + (y[1]-x[1])**2) ** 0.5
    return z

l = []
l.append([f(p1, p2), p1, p2])
l.append([f(p2, p3), p2, p3])
l.append([f(p1, p3), p1, p3])
l =sorted(l)

l1 = [f(p1, p2), f(p2, p3), f(p1, p3)]
l2 = sorted(set(l1))
if len(l2) == 2 and str((l2[0]**2 + l2[0]**2) ** 0.5)[:8] == str(l2[1])[:8]:
    g = [(l[-1][1][0]+l[-1][2][0])/2, (l[-1][1][1]+l[-1][2][1])/2]
    L = [p1, p2, p3]
    L.remove(l[-1][1])
    L.remove(l[-1][2])
    print(int(2*g[0] - L[0][0]), int(2*g[1] - L[0][1]))
else:
    print(-1)
0