結果
| 問題 | No.361 門松ゲーム2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-11-23 17:11:55 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 433 bytes |
| 記録 | |
| コンパイル時間 | 324 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2026-04-13 11:24:29 |
| 合計ジャッジ時間 | 8,317 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 TLE * 5 -- * 5 |
ソースコード
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)