結果

問題 No.1314 N言っちゃダメゲーム (5)
ユーザー chineristACchineristAC
提出日時 2020-12-13 22:22:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 1,000 ms
コード長 1,757 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 81,848 KB
実行使用メモリ 53,528 KB
最終ジャッジ日時 2023-10-20 04:23:51
合計ジャッジ時間 2,631 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,528 KB
testcase_01 AC 36 ms
53,528 KB
testcase_02 AC 36 ms
53,528 KB
testcase_03 AC 37 ms
53,528 KB
testcase_04 AC 37 ms
53,528 KB
testcase_05 AC 38 ms
53,528 KB
testcase_06 AC 36 ms
53,528 KB
testcase_07 AC 41 ms
53,528 KB
testcase_08 AC 37 ms
53,528 KB
testcase_09 AC 37 ms
53,528 KB
testcase_10 AC 37 ms
53,528 KB
testcase_11 AC 36 ms
53,528 KB
testcase_12 AC 37 ms
53,528 KB
testcase_13 AC 37 ms
53,528 KB
testcase_14 AC 37 ms
53,528 KB
testcase_15 AC 37 ms
53,528 KB
testcase_16 AC 37 ms
53,528 KB
testcase_17 AC 37 ms
53,528 KB
testcase_18 AC 38 ms
53,528 KB
testcase_19 AC 38 ms
53,528 KB
testcase_20 AC 37 ms
53,528 KB
testcase_21 AC 36 ms
53,528 KB
testcase_22 AC 37 ms
53,528 KB
testcase_23 AC 37 ms
53,528 KB
testcase_24 AC 37 ms
53,528 KB
testcase_25 AC 36 ms
53,528 KB
testcase_26 AC 36 ms
53,528 KB
testcase_27 AC 37 ms
53,528 KB
testcase_28 AC 36 ms
53,528 KB
testcase_29 AC 36 ms
53,528 KB
testcase_30 AC 37 ms
53,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

class UnionFindVerSize():
    def __init__(self, N):
        self._parent = [n for n in range(0, N)]
        self._size = [1] * N
        self.group = N

    def find_root(self, x):
        if self._parent[x] == x: return x
        self._parent[x] = self.find_root(self._parent[x])
        stack = [x]
        while self._parent[stack[-1]]!=stack[-1]:
            stack.append(self._parent[stack[-1]])
        for v in stack:
            self._parent[v] = stack[-1]
        return self._parent[x]

    def unite(self, x, y):
        gx = self.find_root(x)
        gy = self.find_root(y)
        if gx == gy: return

        self.group -= 1

        if self._size[gx] < self._size[gy]:
            self._parent[gx] = gy
            self._size[gy] += self._size[gx]
        else:
            self._parent[gy] = gx
            self._size[gx] += self._size[gy]

    def get_size(self, x):
        return self._size[self.find_root(x)]

    def is_same_group(self, x, y):
        return self.find_root(x) == self.find_root(y)

class BIT():
    def __init__(self,n):
        self.BIT=[0]*(n+1)
        self.num=n

    def query(self,idx):
        res_sum = 0
        while idx > 0:
            res_sum += self.BIT[idx]
            idx -= idx&(-idx)
        return res_sum

    #Ai += x O(logN)
    def update(self,idx,x):
        while idx <= self.num:
            self.BIT[idx] += x
            idx += idx&(-idx)
        return

import sys
input = sys.stdin.readline
def Input():
    return input().rstrip()
def ArgI():
    return map(int,Input().split())
def LI():
    return list(map(int,Input().split()))

M,K = ArgI()
B = (M-1)//(K+1)
A = M-1-B

if A%2:
    a = (A+1)//2 + B
    b = (A)//2
    print("Win")
elif B==0:
    print("Draw")
else:
    print("Lose")
0