結果
| 問題 |
No.55 正方形を描くだけの簡単なお仕事です。
|
| コンテスト | |
| ユーザー |
Ricky_pon
|
| 提出日時 | 2020-05-22 09:14:45 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 341 ms / 5,000 ms |
| コード長 | 908 bytes |
| コンパイル時間 | 463 ms |
| コンパイル使用メモリ | 82,600 KB |
| 実行使用メモリ | 76,500 KB |
| 最終ジャッジ日時 | 2024-10-03 23:44:39 |
| 合計ジャッジ時間 | 7,873 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
ソースコード
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
import itertools
def dot(p, q):
return p[0]*q[0] + p[1]*q[1]
def dist(p, q):
return (p[0]-q[0])**2 + (p[1]-q[1])**2
x1, y1, x2, y2, x3, y3 = map(int, readline().split())
p = [(x1, y1), (x2, y2), (x3, y3)]
for x in range(-200, 201):
for y in range(-200, 201):
p.append((x, y))
flag = True
for a in itertools.permutations(p):
flag = True
for i in range(4):
s, t, u = a[i], a[(i+1)%4], a[(i+2)%4]
if dist(s, t) != dist(t, u):
flag = False
break
if dot((s[0]-t[0], s[1]-t[1]), (u[0]-t[0], u[1]-t[1])) != 0:
flag = False
break
if flag:
print(x, y)
quit()
p.pop()
print(-1)
Ricky_pon