結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー Ricky_ponRicky_pon
提出日時 2020-05-22 09:14:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 324 ms / 5,000 ms
コード長 908 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 82,356 KB
実行使用メモリ 76,448 KB
最終ジャッジ日時 2024-04-14 20:54:23
合計ジャッジ時間 7,284 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 179 ms
76,304 KB
testcase_01 AC 295 ms
76,216 KB
testcase_02 AC 196 ms
76,432 KB
testcase_03 AC 184 ms
76,288 KB
testcase_04 AC 324 ms
76,448 KB
testcase_05 AC 288 ms
76,160 KB
testcase_06 AC 324 ms
76,392 KB
testcase_07 AC 290 ms
76,396 KB
testcase_08 AC 290 ms
76,224 KB
testcase_09 AC 291 ms
76,360 KB
testcase_10 AC 287 ms
76,340 KB
testcase_11 AC 128 ms
76,012 KB
testcase_12 AC 309 ms
76,372 KB
testcase_13 AC 252 ms
76,364 KB
testcase_14 AC 176 ms
76,160 KB
testcase_15 AC 290 ms
76,168 KB
testcase_16 AC 178 ms
76,160 KB
testcase_17 AC 309 ms
76,448 KB
testcase_18 AC 124 ms
76,064 KB
testcase_19 AC 295 ms
76,424 KB
testcase_20 AC 175 ms
76,260 KB
testcase_21 AC 172 ms
76,208 KB
testcase_22 AC 312 ms
76,300 KB
testcase_23 AC 206 ms
76,288 KB
testcase_24 AC 129 ms
76,424 KB
権限があれば一括ダウンロードができます

ソースコード

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