Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- int main()
- {
- _test
- {
- int n;
- cin>>n;
- vector<ll int> a(n);
- for(auto &e: a) cin>>e;
- ll int tot = accumulate(a.begin(), a.end(), 0ll);
- if(n==1 && a[0]>=2)
- cout<<"Alice\n";
- else if(tot%2==1)
- cout<<"Bob\n";
- else
- {
- ll int x=0;
- for(int i=0; i<n; i++)
- {
- if(i%2)
- x += a[i];
- }
- if(x%2 != (tot/2)%2)
- cout<<"Alice\n";
- else
- cout<<"Bob\n";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment