結果

問題 No.361 門松ゲーム2
ユーザー PNJPNJ
提出日時 2024-02-25 12:04:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 419 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 70,520 KB
最終ジャッジ日時 2024-02-25 12:04:20
合計ジャッジ時間 3,068 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,460 KB
testcase_01 AC 34 ms
53,460 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 AC 35 ms
53,460 KB
testcase_04 AC 33 ms
53,460 KB
testcase_05 AC 34 ms
53,460 KB
testcase_06 AC 33 ms
53,460 KB
testcase_07 AC 34 ms
53,460 KB
testcase_08 AC 47 ms
62,232 KB
testcase_09 AC 52 ms
64,308 KB
testcase_10 AC 48 ms
62,236 KB
testcase_11 AC 40 ms
59,964 KB
testcase_12 AC 48 ms
64,308 KB
testcase_13 AC 47 ms
64,308 KB
testcase_14 AC 92 ms
68,432 KB
testcase_15 AC 58 ms
66,384 KB
testcase_16 AC 102 ms
70,520 KB
testcase_17 AC 102 ms
70,520 KB
testcase_18 AC 59 ms
66,384 KB
testcase_19 AC 105 ms
70,520 KB
testcase_20 AC 56 ms
66,384 KB
testcase_21 AC 96 ms
70,508 KB
testcase_22 AC 117 ms
70,480 KB
testcase_23 AC 70 ms
68,432 KB
testcase_24 AC 71 ms
68,432 KB
testcase_25 AC 114 ms
70,520 KB
testcase_26 AC 119 ms
70,520 KB
testcase_27 AC 114 ms
70,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L,D = map(int,input().split())
G = [-1 for i in range(L+1)]
for x in range(min(L,5) + 1):
  G[x] = 0

for x in range(6,L+1):
  X = set()
  for i in range(1,L):
    for j in range(i+1,L):
      k = x - i - j
      if j >= k:
        break
      if k - i > D:
        continue
      g = G[i] ^ G[j] ^ G[k]
      X.add(g)
  g = 0
  while g in X:
    g += 1
  G[x] = g

ans = 'kado'
if G[L] == 0:
  ans = 'matsu'
print(ans)
0