結果
問題 |
No.55 正方形を描くだけの簡単なお仕事です。
|
ユーザー |
|
提出日時 | 2019-08-21 16:26:45 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 35 ms / 5,000 ms |
コード長 | 614 bytes |
コンパイル時間 | 93 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-10-09 05:53:10 |
合計ジャッジ時間 | 1,811 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 |
ソースコード
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)