結果
問題 |
No.8 N言っちゃダメゲーム
|
ユーザー |
|
提出日時 | 2015-02-13 01:30:27 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 404 bytes |
コンパイル時間 | 140 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 19,936 KB |
最終ジャッジ日時 | 2024-06-23 19:37:49 |
合計ジャッジ時間 | 6,662 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 TLE * 1 -- * 7 |
ソースコード
#!/usr/bin/env python3 import sys from functools import lru_cache @lru_cache(maxsize=None) def isWinning(N, K, n): for i in reversed(range(n + 1, min(N, n + K + 1))): if not isWinning(N, K, i): return True return False P = int(input()) for line in sys.stdin: N, K = map(int, line.split()) if isWinning(N, K, 0): print("Win") else: print("Lose")