Advertisement
ekzolot

Untitled

Jan 30th, 2023
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int gcd(int x, int y){
  4. if (x==0){
  5. return y;
  6. }
  7. return gcd(y%x, x);
  8. }
  9. signed main() {
  10. int n;
  11. cin >> n;
  12. vector<int> a(n);
  13. for (int i = 0; i < n; i++) {
  14. cin >> a[i];
  15. }
  16. int maximum = a[0];
  17. for (int i = 0; i < n; i++) {
  18. maximum = max(maximum, a[i]);
  19. }
  20. int d = gcd(a[0], a[1]);
  21. for (int i = 2; i < n; i++) {
  22. d = gcd(d, a[i]);
  23. }
  24. if ((maximum/d)%2==n%2){
  25. cout << "Bob" << endl;
  26. } else {
  27. cout << "Alice" << endl;
  28. }
  29. }
  30.  
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement