結果

問題 No.361 門松ゲーム2
ユーザー 前田悠真
提出日時 2025-06-07 14:38:45
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 423 bytes
コンパイル時間 568 ms
コンパイル使用メモリ 82,716 KB
実行使用メモリ 79,652 KB
最終ジャッジ日時 2025-06-07 14:38:58
合計ジャッジ時間 11,268 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21 TLE * 2 -- * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

L, d = map(int, input().split())

from functools import *

@cache
def f(L):
  T = set()
  for i in range(1, L):
    for j in range(i+1, L):
      S = {i, j-i, L-j}
      if len(S)==3 and max(S)-min(S)<=d:
        # print(S)
        cnt = 0
        for s in S:
          cnt ^= f(s)
        T.add(cnt)
  cnt = 0
  while cnt in T:
    cnt += 1
  # print(L, cnt)
  return cnt

if f(L):
  print('kado')
else:
  print('matsu')

0