Problem:


Score : 500 points

Problem Statement

Alice and Brown loves games. Today, they will play the following game.

In this game, there are two piles initially consisting of X and Y stones, respectively.
Alice and Bob alternately perform the following operation, starting from Alice:

Take 2i stones from one of the piles. Then, throw away i of them, and put the remaining i in the other pile. Here, the integer i (1≤i) can be freely chosen as long as there is a sufficient number of stones in the pile.

The player who becomes unable to perform the operation, loses the game.

Given X and Y, determine the winner of the game, assuming that both players play optimally.

Constraints

0 ≤ X, Y ≤ 10^{18}

Input

Input is given from Standard Input in the following format:

X Y

Output

Print the winner: either Alice or Brown.

Sample Input 1

2 1

Sample Output 1

Brown

Alice can do nothing but taking two stones from the pile containing two stones. As a result, the piles consist of zero and two stones, respectively. Then, Brown will take the two stones, and the piles will consist of one and zero stones, respectively. Alice will be unable to perform the operation anymore, which means Brown's victory.

Sample Input 2

5 0

Sample Output 2

Alice

Sample Input 3

0 0

Sample Output 3

Brown

Sample Input 4

4 8

Sample Output 4

Alice



Sample input:
2 1


Sample output:
Brown

Submission status: Wrong Answer

Solution code:
x,y=[(int(x))//2 for x in input().split()]
if x==0 or y==0 and x+y==0:
	print("Brown")
elif x==0 or y==0 and x+y!=0:
	print("Alice")
else:
	if max(x,y)%2==0:
		print("Brown")
	else:
		print("Alice")

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
flag=0

while X>1 or Y>1:
    flag+=1
    key=int(max(X,Y)/2)
    if max(X,Y)<=5:
        key=2
    if X<=Y:
        Y-=2*key
        X+=key
    else:
        X-=2*key
        Y+=key

if int(flag%2)==0:
    print("Brown")

else:
    print("Alice")

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
flag=0

while X>1 or Y>1:
    flag+=1
    key=int(max(X,Y)/2)
    if X<=Y:
        Y-=2*key
        X+=key
    else:
        X-=2*key
        Y+=key

if int(flag%2)==0:
    print("Brown")

else:
    print("Alice")

Submission status: Wrong Answer

Solution code:
import sys
from itertools import accumulate
def input(): return sys.stdin.readline().strip()

def main():
    X, Y = map(int, input().split())
    """
    必勝法は「相手に山の差が１になるようにターンを渡すこと」
    そしたら相手がどんな操作をしてきても再び山の差を１にできるので、
    最終的には(0, 0), (0, 1), (1, 0)のどれかの状態を相手にわたすことになる。

    これどうやったら気づけるの？定常状態があるのがこの手の問題の定石？
    """
    if abs(X - Y) == 1:
        print("Brown")
    else:
        print("Alice")
    

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
print('Alice' if abs(X-Y) < 2 else 'Brown')

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
print('Brown' if abs(x-y)<1 else 'Alice')

Submission status: Wrong Answer

Solution code:
X,Y = map(int, open(0).read().split())
X,Y = min(X,Y),max(X,Y)
if Y <= 1:
    print('Brown')
elif X == 0:
    print('Alice')
else:
    if (X+Y) % 2 == 0:
        print('Alice')
    else:
        print('Brown')

Submission status: Wrong Answer

Solution code:
def main():
    x, y = map(int, input().split())
    pattern = {
        (0, 0),
        (1, 0),
        (1, 1),
        (2, 1),
        (2, 2),
        (3, 0),
        (3, 2),
        (3, 3)
    }

    if (x, y) in pattern:
        print("Brown")
    else:
        print("Alice")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
Flag = True


def Judge(x,y):
    if (x==0 and y == 1):
        print('Alice')
        exit()
    elif (x==1 and y==0) or  (x==0 and y==0):
        print('Brown')
        exit()

def Move(pre,af):
    move = pre//2
    pre = pre%2
    af += move
    return pre,af

while Flag:
    #Turn Alice
    x,y = Move(x,y)
    Judge(x,y)
    y,x = Move(y,x)
    Judge(x,y)

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
if abs(x - y) <= 1:
  print("Alice")
else:
  print("Brown")

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
if abs(x - y) <= 1:
  print("Alice")
else:
  print("Bob")

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce, lru_cache
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float("inf")
mod = 10 ** 9 + 7

X, Y = MAP()

@lru_cache(maxsize=None)
def grundy(a, b):
	if 0 <= a <= 1 and 0 <= b <= 1:
		return 0

	ret = 0
	if a >= 2:
		i = a//2
		if grundy(a%2, b+i) == 0:
			ret = 1
		if a >= 4:
			if grundy(a%2+2, b+(i-1)) == 0:
				ret = 1
	if b >= 2:
		i = b//2
		if grundy(a+i, b%2):
			ret = 1
		if b >= 4:
			if grundy(a+(i-1), b%2+2) == 0:
				ret = 1

	return ret

print("Alice" if grundy(X, Y) else "Brown")

Submission status: Wrong Answer

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
mod = 10**9 + 7

x, y = map(int, input().split())

from collections import defaultdict, deque
d = defaultdict(int)
queue = deque([(1, 0, 1), (1, 1, 1)])
while True:
    a, b, c = queue.popleft()
    if (a, b) == (x, y) or (b, a) == (x, y):
        if c == 1:
            print("Alice")
        else:
            print("Brown")
        sys.exit()
    else:
        c ^= 1
        for i in range(1, a + 1):
            queue.append((a - i, b + 2*i, c))
        for j in range(1, b + 1):
            queue.append((a + 2*j, b - j, c))

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float("inf")
mod = 10 ** 9 + 7

X, Y = MAP()

def grundy(a, b):
	if a == 0 and b == 0:
		return 0
	elif a == 0 and b == 1:
		return 0
	elif a == 1 and b == 0:
		return 0
	elif a == 1 and b == 1:
		return 0

	s = set()
	if a >= 2:
		i = a//2
		s.add(grundy(a%2, b+i))
	if b >= 2:
		i = b//2
		s.add(grundy(a+i, b%2))

	ret = 0
	while ret in s:
		ret += 1

	return ret

print("Alice" if grundy(X, Y) else "Brown")

Submission status: Wrong Answer

Solution code:
print("Alice")

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
if x>y:
  x,y=y,x
  
if (x,y) in [(0,0), (0,1), (1,1), (1,2)]:
  print("Brown")
else:
  print("Alice")

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())

def dp(A, B, iswin):
    # print("#", A, B, iswin)
    if A < 2 and B < 2:
        return iswin
    else:
        if A >= 2:
            ret0 = dp(A % 2, B + A // 2, (not iswin))
        else:
            ret0 = False
        if B >= 2:
            ret1 = dp(A + B // 2, B % 2, (not iswin))
        else:
            ret1 = False
        #
        return (ret0 | ret1)

ans = 'Alice' if dp(X, Y, False) else 'Brown'
print(ans)

Submission status: Wrong Answer

Solution code:
X,Y = map(int,input().split())

print("Alice" if abs(X-Y)>=1 else "Brown")

Submission status: Wrong Answer

Solution code:
X,Y = map(int,input().split())

print("Alice" if abs(X-Y)>=1 else "Bob")

Submission status: Wrong Answer

Solution code:
x,y = map(int, input().split())

if x >3 or y >3 :
    print("Alice")
elif abs(x-y)>1:
    print("Alice")
else:
    print("Brown")

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
X,Y=max(X,Y),min(X,Y)
#print(X,Y)

if X<=1:
  print("Brown")
elif X==2:
  if Y==0:
    print("Alice")
  else:
    print("Brown")
elif X==3:
  if Y<=1:
    print("Alice")
  else:
    print("Brown")
else:
  print("Alice")

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
if abs(x-y)>2:
  print("Alice")
else:
  print("Brown")

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
a=1
if x>=4 or y>=4:
    print('Alice')
else:
    a=1
    while x>1 or y>1:
        if x>y:
            y+=x//2
            x=x%2
            a*=-1
        else:
            x+=y//2
            y=y%2
            a*=-1
    if a==1:
        print('Brown')
    else:
        print('Alice')

Submission status: Wrong Answer

Solution code:
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

# a&a-1が負け状況

X,Y = LI()
if abs(X-Y) == 1:
    print('Brown')
elif X <= 1 and Y <= 1:
    print('Brown')
else:
    print('Alice')

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
cnt=1
if b>a:
    a,b=b,a
a=a-b
b=0
mod_a=a%3
if a==3:
    print('Alice')
elif mod_a==2:
    print('Alice')
elif mod_a==1:
    print('Brown')
elif (mod_a==0)and(a!=3):
    print('Brown')
# if (mod_a==3)and(mod_b==3):
#     print('Alice')
# elif (mod_a==3)and(mod_b==1):
#     print('Alice')
# elif (mod_a==1)and(mod_b==3):
#     print('Alice')
# elif (mod_a==2)and(mod_b==0):
#     print('Alice')    
# elif (mod_a==0)and(mod_b==2):
#     print('Alice')
# else:
#     print('Brown')

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
cnt=1
if b>a:
    a,b=b,a
a=a-b
b=0
mod_a=a%3
if mod_a==2:
    print('Alice')
elif mod_a==1:
    print('Brown')
elif mod_a==0:
    print('Brown')
# if (mod_a==3)and(mod_b==3):
#     print('Alice')
# elif (mod_a==3)and(mod_b==1):
#     print('Alice')
# elif (mod_a==1)and(mod_b==3):
#     print('Alice')
# elif (mod_a==2)and(mod_b==0):
#     print('Alice')    
# elif (mod_a==0)and(mod_b==2):
#     print('Alice')
# else:
#     print('Brown')

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
mod_a=a%4
mod_b=b%4
if (mod_a==3)and(mod_b==3):
    print('Alice')
elif (mod_a==3)and(mod_b==1):
    print('Alice')
elif (mod_a==1)and(mod_b==3):
    print('Alice')
elif (mod_a==2)and(mod_b==0):
    print('Alice')    
elif (mod_a==0)and(mod_b==2):
    print('Alice')
else:
    print('Brown')

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=1
def div(n,m,cnt):
    if n>1:
        m+=(n//2)
        n=(n%2)
        cnt=cnt*(-1)
        # print('n',n)
        # print('m',m)
        # if m>1:
        #     m=(m%2)
        #     n+=(m//2)
        #     cnt=cnt*(-1)
    if m>1:
        n+=(m//2)
        m=(m%2)
        cnt=cnt*(-1)
        # print('n',n)
        # print('m',m)
        # if n>1:
        #     n=(n%2)
        #     m+=(n//2)
        #     cnt=cnt*(-1)
    return n,m,cnt

while (a>1)or(b>1):
    a,b,c=div(a,b,c)
    # print(a)
    # print(b)
    # print(c)
    if (a<2)and(b<2):
        break
if c==-1:
    print('Alice')
elif c==1:
    print('Brown')

Submission status: Wrong Answer

Solution code:
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]

x,y=map(int,input().split())
print(0)

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
cnt = 0
change = 0 #xを考えていたらfalse
while(not((x == 0 and y == 1) or (x == 1 and y == 0) or (x == 0 and y == 0))):
  if change == 0:
    num = int(x/2)
    x -= 2 * num
    y += num
    #cnt += num
    change = 1
  else:
    num = int(y/2)
    y -= 2 * num
    x += num
    #cnt += num
    change = 0
  cnt += 1
if cnt % 2 == 0:
  print("Brown")
else:
  print("Alice")

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
cnt = 0
change = 0 #xを考えていたらfalse
while(not((x == 0 and y == 1) or (x == 1 and y == 0) or (x == 0 and y == 0))):
  if change == 0:
    num = int(x/2)
    x -= 2 * num
    y += num
    cnt += num
    change = 1
  else:
    num = int(y/2)
    y -= 2 * num
    x += num
    cnt += num
    change = 0
    
if cnt % 2 == 0:
  print("Brown")
else:
  print("Alice")

Submission status: Wrong Answer

Solution code:
#一問目
x,y=map(int,input().split())
if abs(x-y)<=1:
    print("Blown")
else:
    print("Alice")

Submission status: Wrong Answer

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    X, Y = map(int, input().split())
    X, Y = max(X, Y), min(X, Y)
    if Y < 2: now = 0
    else: now = 1
    X += Y // 2
    Y -= Y // 2
    count = X // 2
    win = (now + count) % 2
    if win == 0: print("Alice")
    else: print("Brown")

    return 0

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())

if (x, y) in [(1, 2), (2, 1), (1, 0), (0, 1), (1, 1), (3, 2), (2, 3)]:
    print('Brown')
elif (x - y) % 3 == 0 and x == y:
    print('Brown')
else:
    print('Alice')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())

if (x, y) in [(1, 2), (2, 1)]:
    print('Brown')
elif (x - y) % 3 == 0:
    print('Brown' if x == y else 'Alice')
elif (x - y) % 3 == 1:
    print('Brown' if y <= 1 else 'Alice')
else:
    print('Brown' if x <= 1 else 'Alice')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())

if (x, y) in [(1, 2), (2, 1)]:
    print('Brown')
elif (x - y) % 3 == 0:
    print('Brown' if x == y else 'Alice')
elif (x - y) % 3 == 1:
    print('Brown' if y == 1 else 'Alice')
else:
    print('Brown' if x == 1 else 'Alice')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())

if (x, y) in [(1, 2), (2, 1)]:
    print('Brown')
elif (x - y) % 3 == 0:
    print('Brown' if x == y else 'Alice')
elif (x - y) % 3 == 1:
    print('Brown' if x == 1 else 'Alice')
else:
    print('Brown' if y == 1 else 'Alice')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())

if (x, y) in [(1, 2), (1, 1), (0, 0), (2, 1)] or x == y:
    print('Brown')
else:
    print('Alice')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())

if (x, y) in [(1, 2), (1, 1), (0, 0), (2, 1)]:
    print('Brown')
else:
    print('Alice')

Submission status: Wrong Answer

Solution code:
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

X, Y = lr()

if abs(Y - X) >= 2:
    print('Alice')
else:
    print('Bob')

# 24

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())

if x<2 and y<2:
    print("Brown")
elif x==2 and y==2:
    print("Brown")
elif (x==3 and y==0) or (x==0 and y==3):
    print("Alice")
else:
    if (x//2==x/2 and y//2==y/2) or (x//2!=x/2 and y//2!=y/2):
        print("Alice")
    else:
        print("Brown")

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
if abs(X - Y) % 2 == 1:
    print('Brown')
else:
    print('Alice')

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())

# 手番。TrueならAliceの番
turn = True
while X >1 or Y> 1:
    #print(X,Y)
    
    #多い方から取る
    if X>Y:
        pic= X//2
        X -=pic*2
        Y+= pic
    elif X<=Y:
        pic=Y//2
        Y-=pic*2
        X+=pic

    # 手番を変える
    turn = not turn

print("Brown" if turn else "Alice")

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())

# 手番。TrueならAliceの番
turn = True
while X >1 or Y> 1:
    #print(X,Y)
    
    #多い方から取る
    if X>=Y:
        pic= X//2
        X -=pic*2
        Y+= pic
    elif X<Y:
        pic=Y//2
        Y-=pic*2
        X+=pic

    # 手番を変える
    turn = not turn

print("Brown" if turn else "Alice")

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())

# 手番。TrueならAliceの番
turn = True
while X >1 or Y> 1:
    print(X,Y)
    
    #多い方から取る
    if X>=Y:
        pic= X//2
        X -=pic*2
        Y+= pic
    elif X<Y:
        pic=Y//2
        Y-=pic*2
        X+=pic

    # 手番を変える
    turn = not turn

print("Brown" if turn else "Alice")

Submission status: Wrong Answer

Solution code:
def next_tup(x,y):
    if x==0 or x==1:#xを常にでかく
        x,y=y,x
    k=x//2
    x-=2*k
    y+=k
    return (x,y)

def defeat(tup):
    return tup==(1,1) or tup==(0,1) or tup==(1,0) or tup==(0,0)

X,Y=map(int,input().split())
if defeat((X,Y)):
    print("Brown")
else:
    ans=[]
    x_sub1,y_sub1=X,Y
    f=0
    while True:
        z=next_tup(x_sub1,y_sub1)
        if defeat(z):
            break
        else:
            x_sub1,y_sub1=z
            if f==0:
                f=1
            else:
                f=0
    ans.append(f)
    x_sub2,y_sub2=Y,X
    f=0
    while True:
        z=next_tup(x_sub2,y_sub2)
        if defeat(z):
            break
        else:
            x_sub2,y_sub2=z
            if f==0:
                f=1
            else:
                f=0
    ans.append(f)
    if 0 in ans:
        print("Alice")
    else:
        print("Brown")

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
if abs(x-y)<=1:
  print('Blown')
else:
  print('Alice')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

X, Y = MAP()

memo = list2d(1007, 1007, -1)
def rec(x, y):
    if memo[x][y] != -1:
        return memo[x][y]
    if x < 2 and y < 2:
        memo[x][y] = 0
        return 0
    res = 0
    for i in range(2, x+1):
        if not rec(x - 2*i, y + i):
            res = 1
    for i in range(2, y+1):
        if not rec(x + i, y - 2*i):
            res = 1
    memo[x][y] = res
    return res

# for i in range(X+1):
#     for j in range(Y+1):
#         rec(i, j)
# for i in range(X+1):
#     print(memo[i][:Y+1])

X, Y = min(X, Y), max(X, Y)
if Y - X >= 4:
    print('Alice')
elif Y - X == 3 and Y % 2 == 0:
    print('Alice')
else:
    print('Brown')

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())

def change(x,y,turn):
    if turn % 2 == 0:
        if x < 2:
            print("Brown")
            import sys
            sys.exit()
        change(x%2,y+(x//2),turn+1)
    else:
        if y < 2:
            print("Alice")
            import sys
            sys.exit()
        change(x+(y//2), y%2, turn+1)

print(change(x,y,0))

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
if abs(X//2 - Y//2) <= 1:
    print("Brown")
else:
    print("Alice")

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
print('Alice') if (x - y) > 1 else print('Brown')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
print('Alice') if (x + y) > 1 else print('Brown')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())

xy = sorted([x, y])
if xy in [[0, 0], [0, 1], [1, 1], [1, 2], [2, 2], [2, 3], [3, 3]]:
    print('Brown')
else:
    print('Alice')

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()

def dfs(x,y,cnt)->bool:
    if(x<=1 and y<=1): return bool(cnt)
    res=False
    if(x>=2): res=res or dfs(x-2*(x//2),y+x//2,cnt^1)
    if(y>=2): res=res or dfs(x+y//2,y-2*(y//2),cnt^1)
    return res

def resolve():
    x,y=map(int,input().split())
    print("Alice" if(dfs(x,y,0)) else "Brown")
resolve()

Submission status: Wrong Answer

Solution code:
x1,y1 = map(int,input().split())
x2,y2 = x1,y1
def minus(z):
  if z%2==0:
    return z
  else:
    return z-1

i=0
while True:
  if x1+y1==1 or x1+y1==0 or x1*y1==1:break
  elif i%2==0:
    y1+=minus(x1)//2
    x1-=minus(x1)
  elif i%2!=0:
    x1+=minus(y1)//2
    y1-=minus(y1)
  i+=1

j=0
while True:
  if x2+y2==1 or x2+y2==0 or x2*y2==1:break
  elif j%2!=0:
    y2+=minus(x2)//2
    x2-=minus(x2)
  elif j%2==0:
    x2+=minus(y2)//2
    y2-=minus(y2)
  j+=1
  
if j<=i:
  print("Brown" if j%2==0 else("Alice"))
else:
  print("Brown" if i%2==0 else("Alice"))

Submission status: Wrong Answer

Solution code:
x, y = [int(i) for i in input().split()]

print("Alice") if x >= 2 or y >= 2 else print("Brown")

Submission status: Wrong Answer

Solution code:
x, y = [int(i) for i in input().split()]

times = 0
while x >= 2 or y >= 2:
    if x >= y : # xから選ぶ
        if x % 2 == 0:
            y += x // 2
            x = 0
            times += 1
        else:
            y += (x - 1) // 2
            x = 1
            times += 1
    else:
        if y % 2 == 0:
            x += y // 2
            y = 0
            times += 1
        else:
            x += (y - 1) // 2
            y = 1
            times += 1
    
if times % 2 == 0:
    winner = "Brown"
else:
    winner = "Alice"

print(winner)

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
if abs(Y-X)<=2:
    print('Brown')
else:
    print('Alice')

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
cnt = 0
while x>1 or y >1:
    if x>1:
        y+=x//2
        x%=2
    else:
        x+=y//2
        y%=2
    cnt+=1
if cnt%2:
    print('Alice')
else:
    print('Brown')

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
if x+y<2 or (x==1 and y==1) or (x==2 and y==1) or (x==1 and y==2):
    print('Brown')
else:
    print('Alice')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
#ABC59 D

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

x,y = LI()
if x == 0 and y == 0:
    print('Brown')
elif x == 0 or y == 0:
    print('Alice')
else:
    if x % 2 == 0 and y % 2 == 0:
        if x // 2 % 2 == 1 and y // 2 % 2 == 1:
            print('Brown')
        else:
            print('Alice')
    else:
        if x % 2 == 0:
            if x // 2 % 2 == 1:
                print('Brown')
            else:
                print('Alice')
        elif y % 2 == 0:
            if y // 2 % 2 == 1:
                print('Brown')
            else:
                print('Alice')
        else:
            print('Brown')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
#ABC59 D

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

x,y = LI()
if x == 0 and y == 0:
    print('Brown')
elif x == 0 or y == 0:
    print('Alice')
else:
    if (x^y) % 2:
        print('Brown')
    else:
        print('Alice')

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
if X < Y:
    Y, X = X, Y
print("Brown" if (X, Y) in ((1, 0), (2, 1)) or X == Y else "Alice")

Submission status: Wrong Answer

Solution code:
X,Y = map(int,input().split())
if abs(X-Y) < 2:
    print("Blown")
else:
    print("Alice")

Submission status: Wrong Answer

Solution code:
X,Y = map(int,input().split())
if X >= 2 and Y >= 2:
    print("Alice")
else:
    print("Brown")

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
    
print('Alice')

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())

X_, Y_ = X, Y
win0 = 0
while X_ >= 2 :
    Y_ += X_ // 2
    X_ = X_ % 2
    
    X_, Y_ = Y_, X_
    win0 ^= 1

X_, Y_ = Y, X
win1 = 0
while X_ >= 2 :
    Y_ += X_ // 2
    X_ = X_ % 2
    
    X_, Y_ = Y_, X_
    win1 ^= 1

if win0 == 1 or win1 == 1 :
    print('Alice')
else :
    print('Brown')

Submission status: Wrong Answer

Solution code:
a,b = list(map(int,input().split(" ")))
if (a//2 + b//2)%2 == 0:
  print("Alice")
else:
  print("Brown")

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
if (Y-X)%9 in [0,1,8]:
    print("Brown")
else:
    print("Alice")

Submission status: Wrong Answer

Solution code:
import itertools
import math

x,y = map(int,input().split())

if abs(x-y) > 2:
    print("Alice")
else:
    print("Brown")

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
def game(x,y):
    now=(x,y)
    cnt=0
    while True:
        if x<2:break
        d,m=divmod(x,2)
        x,y=y+d,m
        cnt+=1
    return cnt%2
ans=max(game(X,Y),game(Y,X))
if ans==1:print('Alice')
elif ans==0:print('Brown')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())

if abs(x - y) == 1:
    print('Brown')
else:
    print('Alice')

Submission status: Wrong Answer

Solution code:
X,Y = map(int,input().split())

def judege(Z):
  ans = int(Z/2)
  re = Z%2
  # print(ans,re)
  if ans == 0:
    if re == 0:
      return "Brown"
    else:
      return "Alice"
  else:
    return judege(ans+re)

print(judege(X+Y))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

X, Y = map(int, input().split())

if X <= 1 and Y <= 1 or X == 2 and Y == 1 or X == 1 and Y == 2 or X == 3 and Y == 1 or X == 1 and Y == 3:
    print('Brown')
else:
    print('Alice')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

X, Y = map(int, input().split())

if X >= 2 and Y >= 2 or X >= 4 or Y >= 4 or X >= 2 and Y == 0 or X == 0 and Y >= 2:
    print('Alice')
else:
    print('Brown')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

X, Y = map(int, input().split())

if X >= 2 and Y >= 2 or X >= 4 or Y >= 4 or X == 2 and Y == 0 or X == 0 and Y == 2:
    print('Alice')
else:
    print('Brown')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

X, Y = map(int, input().split())

if X >= 2 and Y >= 2 or X >= 4 or Y >= 4:
    print('Alice')
else:
    print('Brown')

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
s=X+Y
m=s%4
g=abs(X-Y)
ex=[[0, 0], [1, 0], [1, 1], [2, 1],[1,2],[0,1]]
if ([X,Y] in ex) or (s>4 and m==1 and g==3) or (s>4 and m==2 and (g==2 or g==4)):
  print("Brown")
else:
  print("Alice")

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
s=X+Y
m=s%4
g=abs(X-Y)
ex=[[0, 0], [1, 0], [1, 1], [2, 1],[1,2],[0,1]]
if ([X,Y] in ex) or (m==1 and g==3) or (m==2 and (g==2 or g==4)):
  print("Brown")
else:
  print("Alice")

Submission status: Wrong Answer

Solution code:


a, b = map(int, input().split())
if a < b:
    a, b = b, a
    
if a <= 1:
    ans = "Brown"
elif a == 2 and b == 1:
    ans = "Brown"
elif a >= 2*b:
    ans = "Alice"
else:
    ans = "Brown"

print(ans)

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
if abs(x-y) <= 1:
  print("Alice")
else:
  print("Brown")

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split());print(['Alice','Blown'][abs(x-y)<2])

Submission status: Wrong Answer

Solution code:
import numpy as np

x,y = map(int, input().split())
z = np.array([x,y])
i = 1

if z[z.argmax()] == 1 or z[z.argmax()] == 0:
    pass
else:
    while not z[z.argmax()] == 1:
        amax, amin = z.argmax(), z.argmin()
        z[amin] += z[amax]//2
        z[amax] = 1 if z[amax]%2 else 0
        i+=1

print("Brown" if i%2 else "Alice")

Submission status: Wrong Answer

Solution code:
X,Y = map(int,input().split(" "))

if abs(X-Y) < 1:
	print("Alice")
else:
	print("Brown")

Submission status: Wrong Answer

Solution code:
X,Y  = map(int,input().split(" "))
y = Y + X//2
x = X + Y//2

if (x == 0 or x == 1) and (y == 0 or y ==  1):
	print("Brown")
	exit(0)
elif (x == 0 or x == 1) or (y == 0 or y ==  1):
	print("Alice")
	exit(0)

if y % 2 == 1:
	if x % 2 == 1:
		if x == y:
			print("Brown")
		else:
			print("Alice")

	else:
		if x + 1 == y:
			print("Brown")
		else:
			print("Alice")

else:
	if x % 2 == 1:
		if x == y + 1:
			print("Brown")
		else:
			print("Alice")

	else:
		if x == y:
			print("Brown")
		else:
			print("Alice")

Submission status: Wrong Answer

Solution code:
X, Y = [int(i) for i in input().split(' ')]
player = ['Alice', 'Brown']
count = 0
while True:
    if X<=1 and Y<=1:
        print(player[1-count%2])
        break
    elif X>1:        
        Y += X//2
        X=0 if X%2==0 else 1
    elif Y>1:
        X += Y//2
        Y=0 if Y%2==0 else 1
    count += 1

Submission status: Wrong Answer

Solution code:
#!/usr/bin/envpython
# -*- coding: utf-8 -*-

A, B  = map(int, raw_input().split())

while True:
	
	while A >= 0:
		A -= 2
		B += 1
	else:
		print("Brown")
		break
	
	while B >= 0:
		B -= 2
		A += 1
	else:
		print("Alice")
		break

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split(" ")))
if (a[0] < 2 and a[1] < 2) or a[0] == a[1] or (max(a[:2]) == 2 and min(a[:2])):
    print("Brown")
else:
    print("Alice")

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split(" ")))
if (a[0] < 2 and a[1] < 2) or a[0] == a[1]:
    print("Brown")
else:
    print("Alice")

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
print('Alice' if abs(x-y) <= 1 else 'Brown')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
print('Alice' if abs(x-y) < 1 else 'Brown')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
print('Alice' if abs(x-y) else 'Brown')