結果
| 問題 |
No.361 門松ゲーム2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-06-07 14:42:30 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,492 ms / 2,000 ms |
| コード長 | 458 bytes |
| コンパイル時間 | 495 ms |
| コンパイル使用メモリ | 83,016 KB |
| 実行使用メモリ | 79,252 KB |
| 最終ジャッジ日時 | 2025-06-07 14:42:37 |
| 合計ジャッジ時間 | 6,235 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 28 |
ソースコード
L, d = map(int, input().split())
from functools import *
@cache
def f(L):
T = set()
for i in range(1, L//3+1):
for j in range(i+i+1, L):
S = {i, j-i, L-j}
if max(S)!=L-j: break
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')