結果

問題 No.153 石の山
ユーザー 👑 obakyanobakyan
提出日時 2021-08-06 20:09:05
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 609 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 5,152 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 01:57:54
合計ジャッジ時間 2,017 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 1 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 1 ms
4,348 KB
testcase_22 AC 1 ms
4,348 KB
testcase_23 AC 1 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 2 ms
4,348 KB
testcase_26 AC 1 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 1 ms
4,348 KB
testcase_29 AC 2 ms
4,348 KB
testcase_30 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local mfl, mce = math.floor, math.ceil
local xor = bit.bxor
local n = 100
local t = {0}
for i = 2, n do
  local box = {}
  if 2 <= i and i % 2 == 0 then
    box[0] = true
  end
  if 3 <= i and i % 2 == 1 then
    local j = mfl(i / 2)
    local v = xor(t[j], t[j + 1])
    box[v] = true
  end
  if 3 <= i then
    local j = mfl(i / 3)
    if i % 3 == 0 then
      box[t[j]] = true
    elseif i % 3 == 1 then
      box[t[j + 1]] = true
    else
      box[t[j]] = true
    end
  end
  for j = 0, 1000 do
    if not box[j] then t[i] = j break end
  end
end
local a = io.read("*n")
print(t[a] == 0 and "B" or "A")
0