結果
問題 | 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, 0for y = 1, h, 1 dos = io.read()for x = 1, w, 1 doa = string.sub(s, x, x)if(a == "*") thenif(x1 == 0) then x1, y1 = x, y;elseif(x2 == 0) then x2, y2 = x, y;endendendendif(x1 == x2) thenx3, y3 = 1 + x1 % w, y1elseif(y1 == y2) thenx3, y3 = x1, 1 + y1 % helsex3, y3 = x1, y2endfor y = 1, h, 1 dofor x = 1, w, 1 doif((x1 == x and y1 == y) or (x2 == x and y2 == y) or (x3 == x and y3 == y)) then io.write("*") else io.write("-") endendio.write("\n")end