結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー ciirociiro
提出日時 2021-12-30 22:07:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 550 ms / 5,000 ms
コード長 823 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 44,144 KB
最終ジャッジ日時 2024-04-16 08:05:54
合計ジャッジ時間 16,473 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 532 ms
44,008 KB
testcase_01 AC 527 ms
43,908 KB
testcase_02 AC 543 ms
44,008 KB
testcase_03 AC 535 ms
43,752 KB
testcase_04 AC 535 ms
43,532 KB
testcase_05 AC 529 ms
43,492 KB
testcase_06 AC 540 ms
43,628 KB
testcase_07 AC 530 ms
44,132 KB
testcase_08 AC 526 ms
44,144 KB
testcase_09 AC 533 ms
43,752 KB
testcase_10 AC 529 ms
43,880 KB
testcase_11 AC 536 ms
43,876 KB
testcase_12 AC 528 ms
43,496 KB
testcase_13 AC 535 ms
43,624 KB
testcase_14 AC 544 ms
43,756 KB
testcase_15 AC 537 ms
43,524 KB
testcase_16 AC 534 ms
43,756 KB
testcase_17 AC 536 ms
43,884 KB
testcase_18 AC 550 ms
44,008 KB
testcase_19 AC 537 ms
43,496 KB
testcase_20 AC 535 ms
43,872 KB
testcase_21 AC 533 ms
43,752 KB
testcase_22 AC 537 ms
43,992 KB
testcase_23 AC 540 ms
44,000 KB
testcase_24 AC 548 ms
43,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

x1,y1,x2,y2,x3,y3 = map(int, input().split())

d1 = np.array([x1, y1])
d2 = np.array([x2, y2])
d3 = np.array([x3, y3])

v1 = np.array([x1 - x2, y1 - y2])   
v2 = np.array([x2 - x3, y2 - y3])
v3 = np.array([x3 - x1, y3 - y1])

if np.dot(v1, v2) == 0 and np.dot(v1, v1) == np.dot(v2, v2):
	for i in [1, -1]:
		for j in [1, -1]:
			if all(d1 + i * v2 == d3 + j * v1):
				print((d1 + i * v2)[0], (d1 + i * v2)[1])

elif np.dot(v2, v3) == 0 and np.dot(v2, v2) == np.dot(v3, v3):
	for i in [1, -1]:
		for j in [1, -1]:
			if all(d2 + i * v3 == d1 + j * v2):
				print((d2 + i * v3)[0], (d2 + i * v3)[1])

elif np.dot(v1, v3) == 0 and np.dot(v1, v1) == np.dot(v3, v3):
	for i in [1, -1]:
		for j in [1, -1]:
			if all(d3 + i * v1 == d2 + j * v3):
				print((d3 + i * v1)[0],(d3 + i * v1)[1])
else:
	print(-1)
0