結果
問題 | 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.ceillocal xor = bit.bxorlocal n = 100local t = {0}for i = 2, n dolocal box = {}if 2 <= i and i % 2 == 0 thenbox[0] = trueendif 3 <= i and i % 2 == 1 thenlocal j = mfl(i / 2)local v = xor(t[j], t[j + 1])box[v] = trueendif 3 <= i thenlocal j = mfl(i / 3)if i % 3 == 0 thenbox[t[j]] = trueelseif i % 3 == 1 thenbox[t[j + 1]] = trueelsebox[t[j]] = trueendendfor j = 0, 1000 doif not box[j] then t[i] = j break endendendlocal a = io.read("*n")print(t[a] == 0 and "B" or "A")