結果
| 問題 |
No.55 正方形を描くだけの簡単なお仕事です。
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2019-09-05 21:42:11 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 787 bytes |
| コンパイル時間 | 273 ms |
| コンパイル使用メモリ | 6,948 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-13 03:46:03 |
| 合計ジャッジ時間 | 1,389 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 3 |
| other | AC * 11 WA * 10 |
ソースコード
local x1, y1, x2, y2, x3, y3 = io.read("*n", "*n", "*n", "*n", "*n", "*n")
local x4, y4 = nil, nil
if((y2 - y1) * (y3 - y1) == -(x2 - x1) * (x3 - x1)) then
if(math.abs(y2 - y1) == math.abs(x3 - x1) and math.abs(x2 - x1) == math.abs(y3 - y1)) then
x4, y4 = x2 + x3 - x1, y2 + y3 - y1
end
elseif((y1 - y2) * (y3 - y2) == -(x1 - x2) * (x3 - x2)) then
if(math.abs(y1 - y2) == math.abs(x3 - x2) and math.abs(x1 - x2) == math.abs(y3 - y2)) then
x4, y4 = x1 + x3 - x2, y1 + y3 - y2
end
elseif((y1 - y3) * (y2 - y3) == -(x1 - x3) * (x2 - x3)) then
if(math.abs(y1 - y3) == math.abs(x2 - x3) and math.abs(x1 - x3) == math.abs(y2 - y3)) then
x4, y4 = x1 + x2 - x3, y1 + y2 - y3
end
else
candraw = false
end
print(x4 ~= nil and string.format("%d %d\n", x4, y4) or "-1")