Submission #1236354


Source Code Expand

Copy
#include <bits/stdc++.h>
#define REP(i,n,N) for(int i=(n);i<(int)N;i++)
#define p(s) cout<<(s)<<endl
#define ck(n,a,b) (a)<=(n)&&(n)<(b)
typedef long long ll;
using namespace std;
const int inf=1e9;


int grundy(ll x, ll y){
	set<int> s;
	REP(i,1,x/2){
		s.insert(grundy(x-2*i,y+i));
	}
	REP(i,1,y/2){
		s.insert(grundy(x+i,y-2*i));
	}
	int ret=0;
	while(s.find(ret)!=s.end()) ret++;
	return ret;
}

int main(){
	ll x,y;
	cin>>x>>y;
	int g=grundy(x,y);
	p(g?"Alice":"Brown");
	return 0;
}

Submission Info

Submission Time
Task D - Alice&Brown
User uwfdai
Language C++14 (GCC 5.4.1)
Score 0
Code Size 518 Byte
Status
Exec Time 254 ms
Memory 262400 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 00-00.txt, 00-01.txt, 00-02.txt, 00-03.txt
All 0 / 500 00-00.txt, 00-01.txt, 00-02.txt, 00-03.txt, 01-00.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt
Case Name Status Exec Time Memory
00-00.txt 1 ms 256 KB
00-01.txt 1 ms 256 KB
00-02.txt 1 ms 256 KB
00-03.txt 1 ms 256 KB
01-00.txt 254 ms 262400 KB
01-01.txt 1 ms 256 KB
01-02.txt 213 ms 262400 KB
01-03.txt 216 ms 262400 KB
01-04.txt 214 ms 262400 KB
01-05.txt 1 ms 256 KB
01-06.txt 214 ms 262400 KB
01-07.txt 217 ms 262400 KB
01-08.txt 1 ms 256 KB
01-09.txt 1 ms 256 KB
01-10.txt 217 ms 262400 KB
01-11.txt 216 ms 262400 KB
01-12.txt 218 ms 262400 KB
01-13.txt 216 ms 262400 KB
01-14.txt 214 ms 262400 KB
01-15.txt 215 ms 262400 KB
01-16.txt 214 ms 262400 KB
01-17.txt 1 ms 256 KB
01-18.txt 215 ms 262400 KB
01-19.txt 215 ms 262400 KB