結果

問題 No.361 門松ゲーム2
ユーザー chocoruskchocorusk
提出日時 2020-09-26 03:09:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 474 ms / 2,000 ms
コード長 497 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 77,312 KB
最終ジャッジ日時 2023-09-10 21:00:11
合計ジャッジ時間 6,091 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,480 KB
testcase_01 AC 72 ms
71,448 KB
testcase_02 AC 72 ms
71,272 KB
testcase_03 AC 72 ms
71,200 KB
testcase_04 AC 75 ms
71,096 KB
testcase_05 AC 72 ms
71,404 KB
testcase_06 AC 72 ms
71,296 KB
testcase_07 AC 72 ms
71,268 KB
testcase_08 AC 85 ms
76,656 KB
testcase_09 AC 84 ms
76,508 KB
testcase_10 AC 85 ms
76,620 KB
testcase_11 AC 81 ms
76,852 KB
testcase_12 AC 85 ms
76,348 KB
testcase_13 AC 86 ms
76,460 KB
testcase_14 AC 208 ms
76,508 KB
testcase_15 AC 101 ms
76,520 KB
testcase_16 AC 271 ms
76,972 KB
testcase_17 AC 254 ms
76,468 KB
testcase_18 AC 106 ms
76,692 KB
testcase_19 AC 266 ms
76,516 KB
testcase_20 AC 94 ms
76,420 KB
testcase_21 AC 247 ms
76,728 KB
testcase_22 AC 474 ms
77,312 KB
testcase_23 AC 180 ms
76,432 KB
testcase_24 AC 305 ms
76,268 KB
testcase_25 AC 310 ms
76,676 KB
testcase_26 AC 307 ms
76,932 KB
testcase_27 AC 307 ms
76,920 KB
権限があれば一括ダウンロードができます

ソースコード

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