Alice and Bob are playing a game with ai stones.

Alice and Bob will play a game alternating turns with Alice going first.

On a player's turn, they must choose exactly n2 nonempty piles).

Given the starting configuration, determine who will win the game.

Input

The first line contains one integer n is an even number.

The second line contains 1≤ai≤50) — the number of stones in the piles.

Output

Print a single string "Alice" if Alice wins; otherwise, print "Bob" (without double quotes).

Examples

Input
2
8 8
Output
Bob
Input
4
3 1 4 1
Output
Alice

题意:
给偶数(n)堆石子,每一步必须取n/2堆石子中的任意多个,当场上不足n/2堆石子时,当前玩家失败,问谁是最后的获胜者。
思路:
如果有任何一堆石子已经被拿空,那么只需要直接取空n/2堆石子,便可以获胜。
所以作为后手,如果能维护石子数量最小的堆数量大于N,便可以取胜,因为在这种情况下,石子数越来越少,先手总会拿空一堆。

#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<ctime>
#define fuck(x) cout<<#x<<" = "<<x<<endl;
#define debug(a,i) cout<<#a<<"["<<i<<"] = "<<a[i]<<endl;
#define ls (t<<1)
#define rs ((t<<1)+1)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int maxn = 100086;
const int maxm = 100086;
const int inf = 2.1e9;
const ll Inf = 999999999999999999;
const int mod = 1000000007;
const double eps = 1e-6;
const double pi = acos(-1);
int num[maxn];
int main()
{
//    ios::sync_with_stdio(false);
//    freopen("in.txt","r",stdin);
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d",&num[i]);
    }
    sort(num+1,num+1+n);
    if(num[n/2+1]!=num[1]){printf("Alice\n");}
    else printf("Bob\n");
    return 0;
}
View Code

 

相关文章:

  • 2022-01-29
  • 2021-05-26
  • 2021-07-19
  • 2021-06-14
  • 2021-10-06
  • 2022-02-24
  • 2022-02-14
  • 2021-12-04
猜你喜欢
  • 2022-02-07
  • 2021-08-07
  • 2021-12-19
  • 2022-12-23
  • 2021-11-23
  • 2021-06-16
  • 2021-08-06
相关资源
相似解决方案