結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー 👑 obakyanobakyan
提出日時 2021-07-26 22:12:09
言語 Lua
(LuaJit 2.1.1696795921)
結果
WA  
実行時間 -
コード長 787 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 5,296 KB
実行使用メモリ 119,436 KB
最終ジャッジ日時 2023-09-29 19:09:21
合計ジャッジ時間 92,392 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 3 ms
4,380 KB
testcase_08 AC 3,825 ms
85,344 KB
testcase_09 AC 739 ms
17,644 KB
testcase_10 AC 3,008 ms
63,232 KB
testcase_11 AC 1,978 ms
50,128 KB
testcase_12 AC 4,433 ms
109,624 KB
testcase_13 AC 4,960 ms
115,180 KB
testcase_14 AC 2,796 ms
61,284 KB
testcase_15 TLE -
testcase_16 AC 4,394 ms
105,388 KB
testcase_17 AC 4,786 ms
114,592 KB
testcase_18 WA -
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 864 ms
101,676 KB
testcase_21 TLE -
testcase_22 TLE -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
testcase_36 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

local ffi = require("ffi")
local C = ffi.C
ffi.cdef[[
long long atoll(const char*);
]]

local function lltonumber(str)
  return C.atoll(str)
end

local n = io.read("*n", "*l")
local str = io.read()
local a = {}
for w in str:gmatch("%d+") do
  table.insert(a, lltonumber(w))
end
local ret = 1LL
local t = {}
for i = 1, n do
  t[i] = {}
  local ai = a[i]
  for j = 1, 60 do
    t[i][j] = ai % 2LL == 1LL
    ai = ai / 2LL
  end
end
for j = 1, 60 do
  for i = 1, n do
    if t[i][j] then
      ret = ret + ret
      for k = i + 1, n do
        for l = j, 60 do
          if t[i][l] then
            t[k][l] = not t[k][l]
          end
        end
      end
      for k = j, 60 do
        t[i][k] = false
      end
      break
    end
  end
end
ret = tostring(ret):gsub("LL", "")
print(ret)
0