結果
| 問題 |
No.361 門松ゲーム2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-11-23 17:11:55 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 433 bytes |
| コンパイル時間 | 221 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 16,128 KB |
| 最終ジャッジ日時 | 2024-09-26 08:13:20 |
| 合計ジャッジ時間 | 7,908 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 TLE * 2 -- * 11 |
ソースコード
L, D = map(int, input().split())
dp = [0] * (L + 1)
for x in range(1, L + 1):
s = set()
for a in range(1, x):
for b in range(a + 1, x):
c = x - a - b
if b < c and c - a <= D:
xor = dp[a] ^ dp[b] ^ dp[c]
s.add(xor)
mex = 0
while 1:
if mex not in s:
break
mex += 1
dp[x] = mex
ans = "kado" if dp[L] else "matsu"
print(ans)