結果

問題 No.361 門松ゲーム2
ユーザー PNJPNJ
提出日時 2023-11-06 05:49:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 419 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2023-12-29 01:08:38
合計ジャッジ時間 15,910 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,112 KB
testcase_01 AC 30 ms
10,112 KB
testcase_02 AC 30 ms
10,112 KB
testcase_03 AC 30 ms
10,112 KB
testcase_04 AC 30 ms
10,112 KB
testcase_05 AC 34 ms
10,112 KB
testcase_06 AC 30 ms
10,112 KB
testcase_07 AC 31 ms
10,112 KB
testcase_08 AC 40 ms
10,112 KB
testcase_09 AC 42 ms
10,112 KB
testcase_10 AC 37 ms
10,112 KB
testcase_11 AC 32 ms
10,112 KB
testcase_12 AC 40 ms
10,112 KB
testcase_13 AC 39 ms
10,112 KB
testcase_14 AC 1,101 ms
10,112 KB
testcase_15 AC 115 ms
10,112 KB
testcase_16 AC 1,194 ms
10,112 KB
testcase_17 AC 908 ms
10,112 KB
testcase_18 AC 178 ms
10,112 KB
testcase_19 AC 968 ms
10,112 KB
testcase_20 AC 89 ms
10,112 KB
testcase_21 AC 1,072 ms
10,112 KB
testcase_22 TLE -
testcase_23 AC 1,132 ms
10,112 KB
testcase_24 AC 1,130 ms
10,112 KB
testcase_25 AC 1,118 ms
10,112 KB
testcase_26 AC 1,164 ms
10,112 KB
testcase_27 AC 1,206 ms
10,112 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