博弈好题汇总

博弈题汇总

C. Thanos Nim(2000)

难度⭐⭐⭐
传送门

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define MAXN 2000005
int t;
int n,k;
int boyi[MAXN];
int a[MAXN];
int main() {
    
    
    cin>>n;
    for(int i=1;i<=n;i++)
        cin>>a[i];
    sort(a+1,a+1+n);
    int tot=0;
    for(int i=1;i<=n;i++)
    {
    
    
        if(a[i]>a[1])tot++;
    }
    if(tot==n||tot<n/2)cout<<"Bob"<<endl;
    else cout<<"Alice"<<endl;
}

猜你喜欢

转载自blog.csdn.net/weixin_43353639/article/details/108024362
今日推荐