結果

問題 No.987 N×Mマス計算(基本)
ユーザー 👑 obakyanobakyan
提出日時 2020-02-15 19:44:49
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 423 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 5,460 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-07-28 19:20:59
合計ジャッジ時間 1,159 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 6 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 6 ms
4,380 KB
testcase_05 AC 4 ms
4,380 KB
testcase_06 AC 6 ms
4,380 KB
testcase_07 AC 3 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 8 ms
4,376 KB
testcase_12 AC 8 ms
4,380 KB
testcase_13 AC 4 ms
4,384 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 4 ms
4,380 KB
testcase_16 AC 10 ms
4,380 KB
testcase_17 AC 6 ms
4,380 KB
testcase_18 AC 9 ms
4,380 KB
testcase_19 AC 12 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local n, m = io.read("*n", "*n", "*l")
local str = io.read()
local op = str:sub(1, 1)
local b = {}
for s in str:gmatch("(%d+)") do
  table.insert(b, tonumber(s))
end
local a = {}
for i = 1, n do
  a[i] = io.read("*n")
end
for i = 1, n do
  for j = 1, m do
    local v = op == "+" and a[i] + b[j] or (0LL + a[i]) * b[j]
    local z = tostring(v):gsub("LL", "")
    io.write(z)
    io.write(j == m and "\n" or " ")
  end
end
0