結果
| 問題 |
No.455 冬の大三角
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2019-03-27 09:55:57 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 649 bytes |
| コンパイル時間 | 93 ms |
| コンパイル使用メモリ | 6,820 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 02:10:37 |
| 合計ジャッジ時間 | 2,430 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 54 |
ソースコード
h, w = io.read("*n", "*n", "*l")
x1, y1, x2, y2, x3, y3 = 0, 0, 0, 0, 0, 0
for y = 1, h, 1 do
s = io.read()
for x = 1, w, 1 do
a = string.sub(s, x, x)
if(a == "*") then
if(x1 == 0) then x1, y1 = x, y;
elseif(x2 == 0) then x2, y2 = x, y;
end
end
end
end
if(x1 == x2) then
x3, y3 = 1 + x1 % w, y1
elseif(y1 == y2) then
x3, y3 = x1, 1 + y1 % h
else
x3, y3 = x1, y2
end
for y = 1, h, 1 do
for x = 1, w, 1 do
if((x1 == x and y1 == y) or (x2 == x and y2 == y) or (x3 == x and y3 == y)) then io.write("*") else io.write("-") end
end
io.write("\n")
end