結果

問題 No.1338 Giant Class
コンテスト
ユーザー obakyan
提出日時 2021-04-11 20:15:36
言語 Lua
(LuaJit 2.1.1774638290)
コンパイル:
luajit -b _filename_ a.out
実行:
luajit _filename_
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 316 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 327 ms
コンパイル使用メモリ 6,656 KB
実行使用メモリ 10,900 KB
最終ジャッジ日時 2026-03-15 14:12:29
合計ジャッジ時間 2,979 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

local h, w, q = io.read("*n", "*n", "*n")
local t = {}
local ret = 1LL * w * h
for iq = 1, q do
  local y, x = io.read("*n", "*n")
  if not t[x] then
    ret = ret - (h - y + 1)
    t[x] = y
  elseif y < t[x] then
    ret = ret - (t[x] - y)
    t[x] = y
  end
  local z = tostring(ret):gsub("LL", "")
  print(z)
end
0