結果

問題 No.361 門松ゲーム2
コンテスト
ユーザー chocorusk
提出日時 2020-09-26 03:09:16
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 497 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 339 ms
コンパイル使用メモリ 85,296 KB
実行使用メモリ 74,028 KB
最終ジャッジ日時 2026-03-17 04:56:30
合計ジャッジ時間 3,265 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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