結果

問題 No.361 門松ゲーム2
ユーザー chocoruskchocorusk
提出日時 2020-09-26 03:09:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 497 bytes
コンパイル時間 833 ms
コンパイル使用メモリ 10,984 KB
実行使用メモリ 12,480 KB
最終ジャッジ日時 2023-09-10 20:59:57
合計ジャッジ時間 7,594 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
12,264 KB
testcase_01 AC 16 ms
7,880 KB
testcase_02 AC 15 ms
7,876 KB
testcase_03 AC 15 ms
7,812 KB
testcase_04 AC 15 ms
7,828 KB
testcase_05 AC 15 ms
7,988 KB
testcase_06 AC 16 ms
7,944 KB
testcase_07 AC 15 ms
7,784 KB
testcase_08 AC 37 ms
7,884 KB
testcase_09 AC 41 ms
7,876 KB
testcase_10 AC 31 ms
7,824 KB
testcase_11 AC 18 ms
7,888 KB
testcase_12 AC 33 ms
7,832 KB
testcase_13 AC 33 ms
7,976 KB
testcase_14 TLE -
testcase_15 AC 302 ms
7,788 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 #

import sys
read=sys.stdin.buffer.read
readline=sys.stdin.buffer.readline
readlines=sys.stdin.buffer.readlines

l, d=map(int, readline().split())
g=[0]*(l+1)
for x in range(1, l+1):
    st=set()
    for a in range(1, x):
        for b in range(1, a):
            c=x-a-b
            if 0<c and c<b and a-c<=d:
                st.add(g[a]^g[b]^g[c])
    i=0
    while True:
        if i not in st:
            g[x]=i
            break
        i+=1
if g[l]:
    print("kado")
else:
    print("matsu")
0