結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー gorugo30gorugo30
提出日時 2021-02-26 13:33:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 35 ms / 5,000 ms
コード長 396 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 82,984 KB
実行使用メモリ 53,980 KB
最終ジャッジ日時 2024-04-10 05:24:45
合計ジャッジ時間 1,878 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,368 KB
testcase_01 AC 34 ms
51,872 KB
testcase_02 AC 34 ms
52,880 KB
testcase_03 AC 33 ms
51,868 KB
testcase_04 AC 32 ms
52,836 KB
testcase_05 AC 34 ms
52,492 KB
testcase_06 AC 34 ms
52,540 KB
testcase_07 AC 32 ms
52,900 KB
testcase_08 AC 34 ms
52,268 KB
testcase_09 AC 35 ms
53,980 KB
testcase_10 AC 33 ms
53,152 KB
testcase_11 AC 35 ms
52,520 KB
testcase_12 AC 34 ms
53,192 KB
testcase_13 AC 34 ms
52,336 KB
testcase_14 AC 35 ms
52,360 KB
testcase_15 AC 35 ms
53,672 KB
testcase_16 AC 34 ms
53,120 KB
testcase_17 AC 33 ms
53,556 KB
testcase_18 AC 35 ms
52,880 KB
testcase_19 AC 34 ms
52,492 KB
testcase_20 AC 33 ms
52,016 KB
testcase_21 AC 33 ms
53,128 KB
testcase_22 AC 34 ms
52,748 KB
testcase_23 AC 34 ms
52,756 KB
testcase_24 AC 35 ms
52,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x1, y1, x2, y2, x3, y3 = map(int, input().split())
X = [x1, x2, x3]
Y = [y1, y2, y3]
for i in range(3):
    r1 = [X[(i + 1) % 3] - X[i], Y[(i + 1) % 3] - Y[i]]
    r2 = [X[(i - 1) % 3] - X[i], Y[(i - 1) % 3] - Y[i]]
    if r1[0] * r2[0] + r1[1] * r2[1] == 0 and r1[0] ** 2 + r1[1] ** 2 == r2[0] ** 2 + r2[1] ** 2:
        print(X[i] + r1[0] + r2[0], Y[i] + r1[1] + r2[1])
        exit()
print(-1)
0