結果
| 問題 |
No.55 正方形を描くだけの簡単なお仕事です。
|
| コンテスト | |
| ユーザー |
tnoda_
|
| 提出日時 | 2015-08-04 14:50:49 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 12 ms / 5,000 ms |
| コード長 | 509 bytes |
| コンパイル時間 | 93 ms |
| コンパイル使用メモリ | 7,040 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-14 13:50:47 |
| 合計ジャッジ時間 | 1,148 ms |
|
ジャッジサーバー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_