結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー バカらっく
提出日時 2019-09-12 08:11:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 601 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-02 16:58:50
合計ジャッジ時間 1,678 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 13 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8

allXY = [int(i) for i in input().rstrip().split(" ")]
xList = [x for (index, x) in enumerate(allXY) if index % 2 == 0]
yList = [y for (index, y) in enumerate(allXY) if index % 2 == 1]

canSquare = True
if len(set(xList)) != 2 or len(set(yList)) != 2:
    canSquare = False
if abs(max(xList) - min(xList)) != abs(max(yList) - min(yList)):
    canSquare = False

ans = -1
if canSquare:
    x = [p for p in xList if len([sub for sub in xList if sub == p]) == 1][0]
    y = [p for p in yList if len([sub for sub in yList if sub == p]) == 1][0]
    ans = str(x) + " " + str(y)

print(ans)
0