結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー brthyyjpbrthyyjp
提出日時 2021-06-17 19:20:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 5,000 ms
コード長 450 bytes
コンパイル時間 671 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 71,664 KB
最終ジャッジ日時 2023-09-01 22:23:39
合計ジャッジ時間 3,694 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,152 KB
testcase_01 AC 73 ms
71,324 KB
testcase_02 AC 74 ms
71,624 KB
testcase_03 AC 73 ms
71,476 KB
testcase_04 AC 72 ms
71,432 KB
testcase_05 AC 72 ms
71,176 KB
testcase_06 AC 73 ms
71,280 KB
testcase_07 AC 72 ms
71,412 KB
testcase_08 AC 72 ms
71,400 KB
testcase_09 AC 72 ms
71,468 KB
testcase_10 AC 72 ms
71,476 KB
testcase_11 AC 72 ms
71,336 KB
testcase_12 AC 72 ms
71,488 KB
testcase_13 AC 72 ms
71,384 KB
testcase_14 AC 72 ms
71,612 KB
testcase_15 AC 70 ms
71,280 KB
testcase_16 AC 70 ms
71,472 KB
testcase_17 AC 71 ms
71,392 KB
testcase_18 AC 70 ms
71,276 KB
testcase_19 AC 71 ms
71,312 KB
testcase_20 AC 68 ms
71,420 KB
testcase_21 AC 69 ms
71,664 KB
testcase_22 AC 68 ms
71,148 KB
testcase_23 AC 69 ms
71,280 KB
testcase_24 AC 69 ms
71,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x1, y1, x2, y2, x3, y3 = map(int, input().split())
P = [(x1, y1), (x2, y2), (x3, y3)]
import itertools
for p in itertools.permutations(range(3)):
    x0, y0 = P[p[0]]
    x1, y1 = P[p[1]]
    x2, y2 = P[p[2]]
    v0 = (x1-x0, y1-y0)
    v1 = (x2-x0, y2-y0)
    if v0[0]*v1[0]+v0[1]*v1[1] == 0 and v0[0]**2+v0[1]**2 == v1[0]**2+v1[1]**2:
        x3 = x0+v0[0]+v1[0]
        y3 = y0+v0[1]+v1[1]
        print(x3, y3)
        exit()
else:
    print(-1)
0