結果
問題 | No.55 正方形を描くだけの簡単なお仕事です。 |
ユーザー | ABKZ |
提出日時 | 2024-01-27 10:40:22 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 43 ms / 5,000 ms |
コード長 | 1,787 bytes |
コンパイル時間 | 273 ms |
コンパイル使用メモリ | 82,640 KB |
実行使用メモリ | 52,608 KB |
最終ジャッジ日時 | 2024-09-28 09:35:54 |
合計ジャッジ時間 | 2,267 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 42 ms
51,840 KB |
testcase_01 | AC | 42 ms
51,968 KB |
testcase_02 | AC | 42 ms
51,840 KB |
testcase_03 | AC | 43 ms
52,096 KB |
testcase_04 | AC | 42 ms
52,352 KB |
testcase_05 | AC | 42 ms
52,608 KB |
testcase_06 | AC | 42 ms
51,968 KB |
testcase_07 | AC | 43 ms
52,096 KB |
testcase_08 | AC | 43 ms
52,352 KB |
testcase_09 | AC | 42 ms
52,224 KB |
testcase_10 | AC | 42 ms
52,608 KB |
testcase_11 | AC | 42 ms
52,352 KB |
testcase_12 | AC | 41 ms
52,352 KB |
testcase_13 | AC | 42 ms
52,352 KB |
testcase_14 | AC | 43 ms
51,840 KB |
testcase_15 | AC | 43 ms
52,352 KB |
testcase_16 | AC | 41 ms
52,232 KB |
testcase_17 | AC | 42 ms
51,968 KB |
testcase_18 | AC | 42 ms
52,224 KB |
testcase_19 | AC | 43 ms
52,224 KB |
testcase_20 | AC | 42 ms
51,968 KB |
testcase_21 | AC | 41 ms
52,096 KB |
testcase_22 | AC | 41 ms
52,096 KB |
testcase_23 | AC | 42 ms
51,968 KB |
testcase_24 | AC | 43 ms
52,480 KB |
ソースコード
X1,Y1,X2,Y2,X3,Y3 = map(int, input().split()) leftend_x = min(X1, X2, X3) if X1 == X2 == X3 or Y1 == Y2 == Y3: print(-1) elif X1 == X2: if abs(Y1 - Y2) == abs(X1 - X3) and Y1 == Y3: print(X3, Y2) elif abs(Y1 - Y2) == abs(X1 - X3) and Y2 == Y3: print(X3, Y1) elif (Y1 + Y2) / 2 == Y3: print(2 * X1 - X3, Y3) else: print(-1) elif X2 == X3: if abs(Y2 - Y3) == abs(X2 - X1) and Y2 == Y1: print(X1, Y3) elif abs(Y2 - Y3) == abs(X2 - X1) and Y3 == Y1: print(X1, Y2) elif (Y2 + Y3) / 2 == Y1: print(2 * X2 - X1, Y1) else: print(-1) elif X3 == X1: if abs(Y3 - Y1) == abs(X2 - X1) and Y3 == Y2: print(X2, Y1) elif abs(Y3 - Y1) == abs(X2 - X1) and Y1 == Y2: print(X2, Y3) elif (Y1 + Y3) / 2 == Y2: print(2 * X1 - X2 ,Y2) else: print(-1) elif leftend_x == X1 and (Y2 - Y1) / (X2 - X1) == (Y3 - Y1) / (X3 - X1): print(-1) elif leftend_x == X2 and (Y1 - Y2) / (X1 - X2) == (Y3 - Y2) / (X3 - X2): print(-1) elif leftend_x == X3 and (Y1 - Y3) / (X1 - X3) == (Y1 - Y3) / (X2 - X3): print(-1) else: X4 = X2 + X3 - X1 Y4 = Y2 + Y3 - Y1 XD4 = abs(max(X1, X2, X3, X4) - min(X1, X2, X3, X4)) YD4 = abs(max(Y1, Y2, Y3, Y4) - min(Y1, Y2, Y3, Y4)) X5 = X1 + X3 - X2 Y5 = Y1 + Y3 - Y2 XD5 = abs(max(X1, X2, X3, X5) - min(X1, X2, X3, X5)) YD5 = abs(max(Y1, Y2, Y3, Y5) - min(Y1, Y2, Y3, Y5)) X6 = X1 + X2 - X3 Y6 = Y1 + Y2 - Y3 XD6 = abs(max(X1, X2, X3, X6) - min(X1, X2, X3, X6)) YD6 = abs(max(Y1, Y2, Y3, Y6) - min(Y1, Y2, Y3, Y6)) if XD4 == YD4: print(X4, Y4) elif XD5 == YD5: print(X5, Y5) elif XD6 == YD6: print(X6, Y6) else: print(-1)