結果

問題 No.1091 Range Xor Query
ユーザー 👑 obakyanobakyan
提出日時 2020-06-24 09:18:27
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 217 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 54 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-16 20:54:49
合計ジャッジ時間 6,134 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 40 ms
4,376 KB
testcase_04 AC 125 ms
4,380 KB
testcase_05 AC 152 ms
4,376 KB
testcase_06 AC 8 ms
4,380 KB
testcase_07 AC 136 ms
4,376 KB
testcase_08 AC 199 ms
4,376 KB
testcase_09 AC 92 ms
4,380 KB
testcase_10 AC 141 ms
4,376 KB
testcase_11 AC 177 ms
4,376 KB
testcase_12 AC 107 ms
4,376 KB
testcase_13 AC 203 ms
4,380 KB
testcase_14 AC 148 ms
4,376 KB
testcase_15 AC 164 ms
4,376 KB
testcase_16 AC 147 ms
4,376 KB
testcase_17 AC 202 ms
4,380 KB
testcase_18 AC 30 ms
4,380 KB
testcase_19 AC 45 ms
4,376 KB
testcase_20 AC 194 ms
4,380 KB
testcase_21 AC 96 ms
4,380 KB
testcase_22 AC 189 ms
4,380 KB
testcase_23 AC 207 ms
4,380 KB
testcase_24 AC 211 ms
4,376 KB
testcase_25 AC 211 ms
4,376 KB
testcase_26 AC 209 ms
4,380 KB
testcase_27 AC 217 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local xor = bit.bxor
local n, q = io.read("*n", "*n")
local t = {}
local z = 0
for i = 1, n do
  local a = io.read("*n")
  z = xor(z, a)
  t[i] = z
end
for iq = 1, q do
  local l, r = io.read("*n", "*n")
  if l == 1 then
    print(t[r])
  else
    print(xor(t[l - 1], t[r]))
  end
end
0