問題一覧 > 通常問題

No.1314 Don't Say N Game (5)

レベル : / AI推定難易度 : 1300 / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 112
作問者 : kzyKT / テスター : ei1333333
お気に入りにしたユーザー ProblemId : 5463 / 自分の提出
問題文最終更新日: 2020-12-11 00:50:07
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
Advent Calendar Contest 2020 (順位表) の他の問題:

Problem Statement

You and Grant are playing the so-called "Don't Say 21 Game" (in some places also called the stick-taking game).

Extending the rules, consider the following game using positive integers $N$ and $K$.

1. First, the player moving first is given 0.
2. From there, the player adds one of the integers from $1$ to $K$ to the given integer, declares the result, and passes it to the opposing player, trying not to declare a number that is $N$ or greater (declaring such a number loses the game).
3. The players take turns repeating 2. until the game is decided.

It is known that once $N$ and $K$ are fixed, it can be determined which of the first player and the second player wins this game.

Now, the games will be played under the following rules.
$M$ and $K$ are given.
Initially, there is a sequence containing each integer from $2$ to $M$ exactly $1$ time.
First, you start the game as the first player.
The first player chooses $1$ number from the sequence as the $N$ to be used this time, and the game is played using the chosen $N$ and the given $K$.
The $2$ players take this game seriously, so neither of them will deliberately lose a game they can win.
From game $2$ onward, the player who lost the previous game plays as the first player.
The number chosen as $N$ is removed from the sequence.
This is repeated until the sequence becomes empty.

When both you and Grant play so as to win as many times as possible, determine which of you has more wins.

Input

$M\ K$

$M$ and $K$ are given, separated by a space.

All inputs are integers.
$2 \le M,K \le 10^9$

Output

Output "Win" if you have more wins, "Lose" if you have fewer wins, and "Draw" if the numbers of wins are equal.

Sample

Sample 1
Input
2 2
Output
Win
Sample 2
Input
3 10
Output
Draw
Sample 3
Input
10 5
Output
Lose

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。