結果
問題 | No.55 正方形を描くだけの簡単なお仕事です。 |
ユーザー |
|
提出日時 | 2023-07-06 21:41:16 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 43 ms / 5,000 ms |
コード長 | 651 bytes |
コンパイル時間 | 166 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 52,352 KB |
最終ジャッジ日時 | 2024-07-20 16:58:46 |
合計ジャッジ時間 | 2,296 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 |
ソースコード
from itertools import permutationsdef check(p1, p2, p3):x1, y1 = p1x2, y2 = p2x3, y3 = p3if (x1 - x2) ** 2 + (y1 - y2) ** 2 == (x3 - x2) ** 2 + (y3 - y2) ** 2 and (x1 - x2) * (x3 - x2) + (y1 - y2) * (y3 - y2) == 0:return x1 + x3 - x2, y1 + y3 - y2else:return Nonedef func(x, y):if x is None and y is None:return Noneelif x is None:return yelse:return xx1, y1, x2, y2, x3, y3 = map(int, input().split())p = Nonefor perm in permutations([(x1, y1), (x2, y2), (x3, y3)]):p = func(p, check(*perm))if p is not None:print(p[0], p[1])else:print(-1)