結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー akitsugu777akitsugu777
提出日時 2019-08-21 16:20:49
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 579 bytes
コンパイル時間 918 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 8,576 KB
最終ジャッジ日時 2023-07-30 10:12:46
合計ジャッジ時間 1,931 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,444 KB
testcase_01 AC 16 ms
8,448 KB
testcase_02 AC 16 ms
8,352 KB
testcase_03 AC 16 ms
8,464 KB
testcase_04 AC 15 ms
8,376 KB
testcase_05 AC 16 ms
8,452 KB
testcase_06 AC 16 ms
8,336 KB
testcase_07 AC 16 ms
8,532 KB
testcase_08 AC 16 ms
8,560 KB
testcase_09 WA -
testcase_10 AC 16 ms
8,388 KB
testcase_11 WA -
testcase_12 AC 16 ms
8,388 KB
testcase_13 AC 16 ms
8,452 KB
testcase_14 AC 17 ms
8,336 KB
testcase_15 AC 16 ms
8,472 KB
testcase_16 AC 16 ms
8,576 KB
testcase_17 AC 16 ms
8,448 KB
testcase_18 AC 16 ms
8,528 KB
testcase_19 AC 16 ms
8,452 KB
testcase_20 AC 16 ms
8,448 KB
testcase_21 AC 16 ms
8,528 KB
testcase_22 AC 16 ms
8,540 KB
testcase_23 AC 16 ms
8,388 KB
testcase_24 AC 16 ms
8,512 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 (l2[0]**2 + l2[0]**2) ** 0.5 == l2[1]:
    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