結果
問題 | No.55 正方形を描くだけの簡単なお仕事です。 |
ユーザー |
👑 |
提出日時 | 2019-04-04 23:30:14 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 787 bytes |
コンパイル時間 | 407 ms |
コンパイル使用メモリ | 5,376 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-27 07:25:28 |
合計ジャッジ時間 | 1,271 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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, nilif((y2 - y1) * (y3 - y1) == -(x2 - x1) * (x3 - x1)) thenif(math.abs(y2 - y1) == math.abs(x3 - x1) and math.abs(x2 - x1) == math.abs(y3 - y1)) thenx4, y4 = x2 + x3 - x1, y2 + y3 - y1endelseif((y1 - y2) * (y3 - y2) == -(x1 - x2) * (x3 - x2)) thenif(math.abs(y1 - y2) == math.abs(x3 - x2) and math.abs(x1 - x2) == math.abs(y3 - y2)) thenx4, y4 = x1 + x3 - x2, y1 + y3 - y2endelseif((y1 - y3) * (y2 - y3) == -(x1 - x3) * (x2 - x3)) thenif(math.abs(y1 - y3) == math.abs(x2 - x3) and math.abs(x1 - x3) == math.abs(y2 - y3)) thenx4, y4 = x1 + x2 - x3, y1 + y2 - y3endelsecandraw = falseendprint(x4 ~= nil and string.format("%d %d\n", x4, y4) or "-1")