結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー takakintakakin
提出日時 2020-05-07 23:39:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 435 bytes
コンパイル時間 973 ms
コンパイル使用メモリ 10,892 KB
実行使用メモリ 8,300 KB
最終ジャッジ日時 2023-09-16 08:12:06
合計ジャッジ時間 1,545 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,184 KB
testcase_01 AC 16 ms
8,152 KB
testcase_02 AC 16 ms
8,204 KB
testcase_03 AC 16 ms
8,124 KB
testcase_04 AC 16 ms
8,172 KB
testcase_05 AC 15 ms
8,292 KB
testcase_06 AC 15 ms
8,124 KB
testcase_07 AC 16 ms
8,248 KB
testcase_08 AC 16 ms
8,128 KB
testcase_09 AC 15 ms
8,180 KB
testcase_10 AC 16 ms
8,112 KB
testcase_11 AC 15 ms
8,132 KB
testcase_12 AC 16 ms
8,300 KB
testcase_13 AC 15 ms
8,136 KB
testcase_14 AC 15 ms
8,204 KB
testcase_15 AC 16 ms
8,172 KB
testcase_16 AC 15 ms
8,156 KB
testcase_17 AC 15 ms
8,136 KB
testcase_18 AC 15 ms
8,124 KB
testcase_19 AC 15 ms
8,132 KB
testcase_20 AC 15 ms
8,192 KB
testcase_21 AC 15 ms
8,288 KB
testcase_22 AC 15 ms
8,252 KB
testcase_23 AC 16 ms
8,280 KB
testcase_24 AC 15 ms
8,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
x1,y1,x2,y2,x3,y3=map(int,input().split())

P=[[x1,y1],[x2,y2],[x3,y3]]

def f(Q1,Q2,Q3):
  if Q2[0]-Q1[0]==Q3[1]-Q1[1] and Q2[1]-Q1[1]==-(Q3[0]-Q1[0]):
    return [Q3[0]+Q2[0]-Q1[0],Q3[1]+Q2[1]-Q1[1]]
  else:
    return False
import itertools
for P1,P2,P3 in itertools.permutations(P,3):
  if f(P1,P2,P3):
    print(*f(P1,P2,P3))
    break
  else:
    continue
else:
  print(-1)
0