Created
March 17, 2020 15:38
-
-
Save jinnatul/20fd3330b11557246c1c0cb8d64a201d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
using namespace std; | |
/*** Typedef ***/ | |
typedef long long ll; | |
typedef unsigned long long ull; | |
/*** Input Output ***/ | |
#define sci1(a) scanf("%d",&a) | |
#define sci2(a,b) scanf("%d %d",&a,&b) | |
#define sc1(a) scanf("%lld",&a) | |
#define sc2(a,b) scanf("%lld %lld",&a,&b) | |
#define sc3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c) | |
#define pf1(a) printf("%d\n",a) | |
#define pf2(a,b) printf("%d %d\n",a,b) | |
#define pf1(a) printf("%lld\n",a) | |
#define pf2(a,b) printf("%lld %lld\n",a,b) | |
/*** Loops ***/ | |
#define for0(num) for(ll i = 0; i < num; i++) | |
#define for1(num) for(ll i = 1; i <= num; i++) | |
#define forr(num) for(ll i = num - 1; i >= 0; i--) | |
#define forin(arr, num) for(ll i = 0; i < num; i++) sc1(arr[i]); | |
#define vpnt(ans) for(ll i = 0; i < ans.size(); i++) cout << ans[i] << (i + 1 < ans.size() ? ' ' : '\n'); | |
#define apnt(arr, num) for(ll i = 0; i < num; i++) cout << arr[i] << (i + 1 < num ? ' ' : '\n'); | |
/*** Define Values ***/ | |
#define mx 1000000 | |
#define mod 1000000007 | |
#define PI acos(-1.0) | |
#define eps 1e-7 | |
#define size1 2005 | |
#define pb push_back | |
#define ff first | |
#define ss second | |
#define mp make_pair | |
#define mem(name, value) memset(name, value, sizeof(name)) | |
/*** STLs ***/ | |
typedef vector <ll> vll; | |
typedef set <ll> sll; | |
typedef multiset <ll> msll; | |
typedef queue <ll> qll; | |
typedef map <ll, ll> mll; | |
typedef pair <ll, ll> pll; | |
typedef vector <pair <ll , ll> > vpll; | |
/*** Sorts ***/ | |
#define all(v) (v).begin(), (v).end() | |
#define rev(v) reverse(all(v)) | |
#define srt(v) sort(all(v)) | |
#define srtGreat(v) sort(all(v), greater<ll>()) | |
inline bool cmp(pll a,pll b){ if(a.ff == b.ff)return a.ss < b.ss; return a.ff > b.ff; } | |
/*** BitWise Operations | |
bool getBit (ll num, ll pos) { return num & (1 << pos); } // get bit right -> left | |
ll setBit (ll num, ll pos) { return num | (1 << pos); } | |
ll chearBit (ll num, ll pos) { ll mask = ~(1 << pos); return num & mask; } | |
ll updateBit (ll num, ll pos, bool bit1or0) { ll value = bit1or0 ? 1 : 0; ll mask = ~(1 << pos); return (num & mask) | (value << pos); } | |
***/ | |
/*** Grids ***/ | |
int drx[8] = {-2,-2,-1,-1,1,1,2,2}; | |
int dcy[8] = {-1,1,-2,2,-2,2,-1,1}; | |
int dirx[4] = { -1, 0, 1, 0 }; | |
int diry[4] = { 0, -1, 0, 1 }; | |
/*** Functions | |
ll BigMod(ll base, ll pow, ll modvalue){ if (pow == 0) return 1; ll ans = BigMod(base, pow / 2, modvalue);ll total = ((ans % modvalue) * (ans % modvalue)) % modvalue; if(pow % 2 == 0) return total; else{ return (total * (base % modvalue) ) % modvalue; } } | |
ll InverseMod(ll base, ll pow) { if(pow == 0) return 1; ll ans = InverseMod(base, pow / 2); ans = (ans * ans) % mod; if(pow & 1){ return (ans * base) % mod; } else{ return ans; } } | |
bool checkprime(ll num) { if(num < 2) return false; for(ll i = 2; i * i <= num; i++){ if(num % i == 0) return false; } return true; } | |
ll EularPHI(ll num) { double ans = num; for(ll i = 2; i * i <= num; i++){ if(num % i == 0){ while (num % i == 0) { num /= i; } ans *= (1.0 - (1.0 / (double)i)); } } if(num > 1) ans *= (1.0 - (1.0 / (double)num)); return (ll)ans; } | |
***/ | |
template <class T> inline T gcd(T a,T b){if(b == 0)return a; return gcd(b, a % b);} | |
template <class T> inline T lcm(T a,T b){return a * b / gcd<T>(a, b);} | |
template <class T> inline T power(T b,T p){ll ans = 1;while(p--) ans *= b; return ans;} | |
/*** Some Prints ***/ | |
#define en cout << '\n'; | |
#define no cout << "NO" << '\n' | |
#define yes cout << "YES" << '\n' | |
#define case cout << "Case " << t++ << ": " | |
ll call(ll num) | |
{ | |
if (num == 1) return 0; | |
if (num % 2 == 0) return num; | |
return call(num / 2); | |
} | |
int main() { | |
ll n, m, num, tc, t = 1; | |
sc1(tc); | |
while (tc--) { | |
sc1(num); | |
ll ans = 0; | |
for0(num) { | |
sc1(n); | |
ans ^= call(n); | |
//cout << ans << endl; | |
} | |
case; | |
if (!ans) cout << "Bob" << endl; | |
else cout << "Alice" << endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment