結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー バカらっくバカらっく
提出日時 2019-09-12 08:11:16
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 601 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 10,812 KB
実行使用メモリ 7,940 KB
最終ジャッジ日時 2023-09-15 14:06:19
合計ジャッジ時間 1,452 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,852 KB
testcase_01 AC 16 ms
7,812 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 16 ms
7,820 KB
testcase_05 AC 15 ms
7,772 KB
testcase_06 AC 16 ms
7,788 KB
testcase_07 AC 16 ms
7,816 KB
testcase_08 AC 16 ms
7,872 KB
testcase_09 AC 16 ms
7,796 KB
testcase_10 AC 16 ms
7,796 KB
testcase_11 WA -
testcase_12 AC 15 ms
7,876 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 15 ms
7,880 KB
testcase_16 WA -
testcase_17 AC 16 ms
7,780 KB
testcase_18 AC 15 ms
7,812 KB
testcase_19 AC 15 ms
7,780 KB
testcase_20 WA -
testcase_21 AC 15 ms
7,932 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

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