結果
問題 | No.883 ぬりえ |
ユーザー |
👑 |
提出日時 | 2020-04-18 20:38:54 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 512 bytes |
コンパイル時間 | 113 ms |
コンパイル使用メモリ | 6,820 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-04 00:15:46 |
合計ジャッジ時間 | 935 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 19 |
ソースコード
local mfl, mce = math.floor, math.ceil local n, k = io.read("*n", "*n") local size = mce(n / k) while size * size < n do size = size + 1 end print(size) local tn = n local offset = 1 for i = 1, size do for j = 1, size do if (size + j - offset) % size < k then if 0 < tn then io.write("#") tn = tn - 1 else io.write(".") end else io.write(".") end end io.write("\n") offset = offset + k if size <= offset then offset = offset - size end end