結果
問題 | No.361 門松ゲーム2 |
ユーザー |
👑 |
提出日時 | 2021-06-13 19:12:03 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 33 ms / 2,000 ms |
コード長 | 541 bytes |
コンパイル時間 | 250 ms |
コンパイル使用メモリ | 5,504 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 08:31:23 |
合計ジャッジ時間 | 1,570 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
local mfl, mce = math.floor, math.ceillocal bxor = bit.bxorlocal n, d = io.read("*n", "*n")local t = {}for i = 1, 5 dot[i] = 0endfor i = 6, n dolocal z = {}local alim = mfl(i / 3)for a = 1, alim dofor b = a + 1, i - a dolocal c = i - a - bif c <= b then break endif c - a <= d thenlocal state = bxor(t[a], bxor(t[b], t[c]))z[state] = trueendendendfor j = 0, 1000000007 doif not z[j] then t[i] = j break endendendprint(t[n] == 0 and "matsu" or "kado")