题解 | 最多取半的巴什博弈
最多取半的巴什博弈
https://www.nowcoder.com/practice/3ec37e1b6a604eb7a688a5532208a45f
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin>>n;
double res1=log2((n+1)/3);
double res2=log2((n+1)*1.0/3);
if(res1==res2){
cout<<"Bob"<<endl;
}else{
cout<<"Alice"<<endl;
}
return 0;
}
查看7道真题和解析