結果

問題 No.883 ぬりえ
ユーザー 👑 obakyan
提出日時 2020-04-18 20:37:37
言語 Lua
(LuaJit 2.1.1734355927)
結果
WA  
実行時間 -
コード長 465 bytes
コンパイル時間 334 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-04 00:15:14
合計ジャッジ時間 1,506 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

local mfl, mce = math.floor, math.ceil
local n, k = io.read("*n", "*n")
local size = mce(n / k)
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
0