Skip to content

Instantly share code, notes, and snippets.

@tina1998612
Created November 13, 2016 15:31
Show Gist options
  • Save tina1998612/98c9cf68539826a84f259d5121dbaa37 to your computer and use it in GitHub Desktop.
Save tina1998612/98c9cf68539826a84f259d5121dbaa37 to your computer and use it in GitHub Desktop.
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
long long cas,n,node,k,sum;
int main() {
scanf("%lld",&cas);
while(cas--){
sum=0;
scanf("%lld",&n);
for(int i=0;i<n;i++){
scanf("%lld%lld",&node,&k);
sum^=(node&1);
}
if(!(n&1) && !sum) printf("BEN\n");
else printf("BOB\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment