結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー yuki2006yuki2006
提出日時 2014-11-02 15:13:40
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 781 bytes
コンパイル時間 618 ms
コンパイル使用メモリ 6,628 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2023-08-29 00:19:36
合計ジャッジ時間 12,388 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 279 ms
6,068 KB
testcase_01 WA -
testcase_02 AC 271 ms
6,020 KB
testcase_03 AC 283 ms
5,892 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 163 ms
6,040 KB
testcase_12 WA -
testcase_13 AC 411 ms
6,000 KB
testcase_14 AC 276 ms
5,996 KB
testcase_15 WA -
testcase_16 AC 274 ms
5,856 KB
testcase_17 WA -
testcase_18 AC 143 ms
5,952 KB
testcase_19 WA -
testcase_20 AC 274 ms
5,932 KB
testcase_21 AC 253 ms
5,860 KB
testcase_22 AC 549 ms
6,056 KB
testcase_23 AC 345 ms
5,896 KB
testcase_24 AC 144 ms
5,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

X1, Y1, X2, Y2, X3, Y3 = map(int, raw_input().split())

X = [0] * 4
Y = [0] * 4

X[0] = X1
X[1] = X2
X[2] = X3

Y[0] = Y1
Y[1] = Y2
Y[2] = Y3


def check():
    list = []
    for i in xrange(4):
        for j in xrange(i + 1, 4):
            dx = X[i] - X[j]
            dy = Y[i] - Y[j]
            list.append(dx * dx + dy * dy)

    list.sort()
    l = list[0]
    return list[0] == l and list[1] == l and list[2] == l and list[3] == l and list[4] == 2 * l and list[5] == 2 * l


def solve():
    for x in xrange(-200, 200 + 1):
        for y in xrange(-200, 200 + 1):
            X[3] = x
            Y[3] = y
            if check():
                print x, y
                return


if __name__ == '__main__':
    solve()
0