結果

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

ソースコード

diff #

local mfl, mce = math.floor, math.ceil
local n, k = io.read("*n", "*n")
local rep = math.floor(n / (k * k))
local rem = n - rep * k * k
local remsize = math.ceil(math.sqrt(rem))
local size = k * rep + remsize
print(size)
for i = 1, size do
  local bi = mce(i / k)
  for j = 1, size do
    local bj = mce(j / k)
    if bi == bj then
      if 0 < n then
        io.write("#")
        n = n - 1
      else
        io.write(".")
      end
    else
      io.write(".")
    end
  end
  io.write("\n")
end
0