結果

問題 No.2154 あさかつの参加人数
ユーザー 👑 obakyanobakyan
提出日時 2022-12-15 00:24:06
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 247 ms / 2,000 ms
コード長 302 bytes
コンパイル時間 574 ms
コンパイル使用メモリ 5,504 KB
実行使用メモリ 13,312 KB
最終ジャッジ日時 2024-04-26 04:17:25
合計ジャッジ時間 9,949 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 247 ms
13,184 KB
testcase_01 AC 238 ms
13,312 KB
testcase_02 AC 244 ms
13,184 KB
testcase_03 AC 243 ms
13,184 KB
testcase_04 AC 240 ms
13,184 KB
testcase_05 AC 134 ms
5,376 KB
testcase_06 AC 194 ms
7,424 KB
testcase_07 AC 114 ms
10,496 KB
testcase_08 AC 109 ms
11,008 KB
testcase_09 AC 26 ms
9,216 KB
testcase_10 AC 99 ms
10,240 KB
testcase_11 AC 207 ms
12,416 KB
testcase_12 AC 164 ms
10,368 KB
testcase_13 AC 101 ms
5,376 KB
testcase_14 AC 178 ms
10,240 KB
testcase_15 AC 95 ms
10,752 KB
testcase_16 AC 170 ms
11,008 KB
testcase_17 AC 201 ms
10,240 KB
testcase_18 AC 203 ms
11,392 KB
testcase_19 AC 12 ms
5,376 KB
testcase_20 AC 158 ms
11,520 KB
testcase_21 AC 19 ms
6,912 KB
testcase_22 AC 38 ms
11,264 KB
testcase_23 AC 206 ms
11,520 KB
testcase_24 AC 208 ms
12,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local n, m = io.read("*n", "*n")
local t = {}
for i = 1, n + 1 do
  t[i] = 0
end
for i = 1, m do
  local l, r = io.read("*n", "*n")
  l = n + 1 - l
  r = n + 1 - r
  t[l] = t[l] + 1
  t[r + 1] = t[r + 1] - 1
end
for i = 2, n do
  t[i] = t[i] + t[i - 1]
end
table.remove(t)
print(table.concat(t, "\n"))
0