結果
問題 |
No.55 正方形を描くだけの簡単なお仕事です。
|
ユーザー |
👑 |
提出日時 | 2022-01-20 21:01:03 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 45 ms / 5,000 ms |
コード長 | 410 bytes |
コンパイル時間 | 996 ms |
コンパイル使用メモリ | 82,044 KB |
実行使用メモリ | 52,328 KB |
最終ジャッジ日時 | 2024-11-24 05:39:19 |
合計ジャッジ時間 | 2,089 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 |
ソースコード
x1, y1, x2, y2, x3, y3 = map(int, input().split()) p1 = (x1, y1) p2 = (x2, y2) p3 = (x3, y3) for a, b, c in [(p1, p2, p3), (p1, p3, p2), (p2, p1, p3)]: dx1 = b[0] - a[0] dy1 = b[1] - a[1] d1 = dx1 ** 2 + dy1 ** 2 dx2 = c[0] - b[0] dy2 = c[1] - b[1] d2 = dx2 ** 2 + dy2 ** 2 if dx1 * dx2 + dy1 * dy2 == 0 and d1 == d2: print(c[0] - dx1, c[1] - dy1) exit() print(-1)