結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー zombietan
提出日時 2016-06-09 08:46:59
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 29 ms / 5,000 ms
コード長 441 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-14 13:54:58
合計ジャッジ時間 1,605 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
import math
x1, y1, x2, y2, x3, y3 = map(int, input().split())
L = [(x1, y1),(x2, y2),(x3, y3)]
for x, y, z in itertools.permutations(L):
    if math.hypot(x[0]-y[0], x[1]-y[1]) != math.hypot(z[0]-y[0], z[1]-y[1]):
        continue
    a, b = (x[0]-y[0],x[1]-y[1])
    c, d = (z[0]-y[0],z[1]-y[1])
    if (a, b) == (-d, c) or (a, b) == (d, -c):
        print(x[0]+z[0]-y[0], x[1]+z[1]-y[1])
        break
else:
    print(-1)
0