結果

問題 No.361 門松ゲーム2
ユーザー gr1msl3ygr1msl3y
提出日時 2022-01-29 13:45:16
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 414 bytes
コンパイル時間 1,061 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 82,304 KB
最終ジャッジ日時 2023-08-30 11:33:01
合計ジャッジ時間 7,605 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,288 KB
testcase_01 AC 71 ms
71,292 KB
testcase_02 AC 79 ms
75,444 KB
testcase_03 AC 75 ms
75,344 KB
testcase_04 AC 71 ms
71,292 KB
testcase_05 AC 71 ms
71,484 KB
testcase_06 AC 80 ms
75,340 KB
testcase_07 AC 82 ms
75,516 KB
testcase_08 AC 124 ms
77,460 KB
testcase_09 AC 125 ms
77,204 KB
testcase_10 AC 112 ms
77,192 KB
testcase_11 AC 93 ms
77,152 KB
testcase_12 AC 114 ms
77,024 KB
testcase_13 AC 114 ms
77,008 KB
testcase_14 TLE -
testcase_15 AC 465 ms
77,240 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())
gr = [-1]*(L+1)
for i in range(1, L+1):
    S = set()
    for j in range(1, i):
        for k in range(1, i-j):
            l = i-j-k
            T = {j, k, l}
            if len(T) == 3 and max(T)-min(T) <= D:
                S.add(gr[j] ^ gr[k] ^ gr[l])
    for j in range(i+1):
        if j not in S:
            gr[i] = j
            break

print('kado' if gr[L] else 'matsu')
0