Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int gcd(int x, int y){
- if (x==0){
- return y;
- }
- return gcd(y%x, x);
- }
- signed main() {
- int n;
- cin >> n;
- vector<int> a(n);
- for (int i = 0; i < n; i++) {
- cin >> a[i];
- }
- int maximum = a[0];
- for (int i = 0; i < n; i++) {
- maximum = max(maximum, a[i]);
- }
- int d = gcd(a[0], a[1]);
- for (int i = 2; i < n; i++) {
- d = gcd(d, a[i]);
- }
- if ((maximum/d)%2==n%2){
- cout << "Bob" << endl;
- } else {
- cout << "Alice" << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement