結果

問題 No.361 門松ゲーム2
ユーザー Nikkuniku029Nikkuniku029
提出日時 2023-11-23 17:11:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 433 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 9,984 KB
最終ジャッジ日時 2023-11-23 17:12:04
合計ジャッジ時間 8,011 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
9,984 KB
testcase_01 AC 27 ms
9,984 KB
testcase_02 AC 28 ms
9,984 KB
testcase_03 AC 30 ms
9,984 KB
testcase_04 AC 28 ms
9,984 KB
testcase_05 AC 28 ms
9,984 KB
testcase_06 AC 27 ms
9,984 KB
testcase_07 AC 28 ms
9,984 KB
testcase_08 AC 52 ms
9,984 KB
testcase_09 AC 59 ms
9,984 KB
testcase_10 AC 45 ms
9,984 KB
testcase_11 AC 30 ms
9,984 KB
testcase_12 AC 51 ms
9,984 KB
testcase_13 AC 50 ms
9,984 KB
testcase_14 TLE -
testcase_15 AC 314 ms
9,984 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

L, D = map(int, input().split())
dp = [0] * (L + 1)
for x in range(1, L + 1):
    s = set()
    for a in range(1, x):
        for b in range(a + 1, x):
            c = x - a - b
            if b < c and c - a <= D:
                xor = dp[a] ^ dp[b] ^ dp[c]
                s.add(xor)
    mex = 0
    while 1:
        if mex not in s:
            break
        mex += 1
    dp[x] = mex
ans = "kado" if dp[L] else "matsu"
print(ans)
0