結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー Ricky_ponRicky_pon
提出日時 2020-05-22 09:14:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 908 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 17,824 KB
最終ジャッジ日時 2024-04-14 20:52:47
合計ジャッジ時間 40,728 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,668 ms
10,752 KB
testcase_01 AC 4,681 ms
10,880 KB
testcase_02 AC 2,600 ms
10,752 KB
testcase_03 AC 2,694 ms
10,752 KB
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 AC 1,587 ms
10,880 KB
testcase_12 TLE -
testcase_13 AC 4,460 ms
11,008 KB
testcase_14 AC 2,959 ms
10,880 KB
testcase_15 TLE -
testcase_16 AC 2,960 ms
10,880 KB
testcase_17 TLE -
testcase_18 AC 1,530 ms
10,880 KB
testcase_19 TLE -
testcase_20 AC 2,626 ms
10,752 KB
testcase_21 AC 2,490 ms
10,880 KB
testcase_22 TLE -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0