题解 | 最多取半的巴什博弈

最多取半的巴什博弈

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;
}


全部评论

相关推荐

03-26 12:00
已编辑
门头沟学院 Java
offer魅魔_oc...:100-200每天,你还要倒贴100
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务