結果
| 問題 | No.55 正方形を描くだけの簡単なお仕事です。 |
| コンテスト | |
| ユーザー |
tnoda_
|
| 提出日時 | 2015-08-04 14:50:49 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 81 ms / 5,000 ms |
| コード長 | 509 bytes |
| 記録 | |
| コンパイル時間 | 212 ms |
| コンパイル使用メモリ | 77,528 KB |
| 最終ジャッジ日時 | 2025-12-03 16:05:58 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
ソースコード
from itertools import permutations
cs = map(int, raw_input().strip().split())
coords = [(cs[i], cs[i+1]) for i in range(0, 6, 2)]
orders = permutations(range(3))
def check(s):
x0, y0 = coords[s[0]]
x1, y1 = coords[s[1]]
x2, y2 = coords[s[2]]
dx = x1 - x0
dy = y1 - y0
if x2 != x1 + dy or y2 != y1 - dx:
return None
return (x0 + dy, y0 - dx)
for orders in permutations(range(3)):
res = check(orders)
if res:
print('%d %d' % res)
quit()
print(-1)
tnoda_