結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー titiatitia
提出日時 2021-12-13 02:25:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 394 ms / 5,000 ms
コード長 692 bytes
コンパイル時間 581 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 78,748 KB
最終ジャッジ日時 2023-09-28 21:17:41
合計ジャッジ時間 10,419 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 265 ms
78,536 KB
testcase_01 AC 390 ms
78,568 KB
testcase_02 AC 262 ms
78,560 KB
testcase_03 AC 271 ms
78,632 KB
testcase_04 AC 394 ms
78,748 KB
testcase_05 AC 379 ms
78,560 KB
testcase_06 AC 384 ms
78,392 KB
testcase_07 AC 385 ms
78,420 KB
testcase_08 AC 386 ms
78,436 KB
testcase_09 AC 382 ms
78,488 KB
testcase_10 AC 381 ms
78,600 KB
testcase_11 AC 237 ms
78,556 KB
testcase_12 AC 382 ms
78,468 KB
testcase_13 AC 305 ms
78,660 KB
testcase_14 AC 267 ms
78,568 KB
testcase_15 AC 385 ms
78,556 KB
testcase_16 AC 272 ms
78,568 KB
testcase_17 AC 377 ms
78,544 KB
testcase_18 AC 231 ms
78,712 KB
testcase_19 AC 381 ms
78,520 KB
testcase_20 AC 262 ms
78,572 KB
testcase_21 AC 260 ms
78,580 KB
testcase_22 AC 354 ms
78,472 KB
testcase_23 AC 286 ms
78,444 KB
testcase_24 AC 224 ms
78,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
x1,y1,x2,y2,x3,y3=map(int,input().split())

def check(x4,y4):
    A=[]
    A.append((x1-x2)**2+(y1-y2)**2)
    A.append((x1-x3)**2+(y1-y3)**2)
    A.append((x1-x4)**2+(y1-y4)**2)
    A.append((x2-x3)**2+(y2-y3)**2)
    A.append((x2-x4)**2+(y2-y4)**2)
    A.append((x3-x4)**2+(y3-y4)**2)

    C=Counter(A)

    MAX=max(C.keys())
    MIN=min(C.keys())

    if MAX!=MIN*2:
        return False

    L=list(C.values())
    if L==[2,4] or L==[4,2]:
        #print(A,C)
        return True
    else:
        return False

for x4 in range(-300,301):
    for y4 in range(-300,301):
        if check(x4,y4)==True:
            print(x4,y4)
            exit()

print(-1)
0