結果
問題 | No.153 石の山 |
ユーザー |
👑 |
提出日時 | 2021-08-06 20:09:05 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 609 bytes |
コンパイル時間 | 273 ms |
コンパイル使用メモリ | 6,688 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-17 00:31:51 |
合計ジャッジ時間 | 1,493 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 27 |
ソースコード
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")