您当前的位置: 首页 >  游戏

*DDL_GzmBlog

暂无认证

  • 3浏览

    0关注

    602博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

[Acwing] 891.Nim游戏 博弈论初步

*DDL_GzmBlog 发布时间:2021-11-03 16:33:31 ,浏览量:3

前言

传送门 :

思路

定理 : a 1 ∧ a 2 . . . ∧ a n = 0 a_1 \wedge a_2...\wedge a_n = 0 a1​∧a2​...∧an​=0 先手必败,否则先手必胜

具体证明看 :

在这里插入图片描述

CODE
#include 
using namespace std;
#define ll long long
#define endl '\n'
#define px first
#define py second
#define pb push_back
typedef pair pii;
int dxy[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
const int N  = 40;

int n,m,t;

void cal()
{

}


void solve()
{
	int n;
	cin>>n;
	
	int ans = 0 ;
	for(int i = 1;i>x;
		ans^=x;
		
	}
	
	if(ans)
	cout            
关注
打赏
1657350525
查看更多评论
0.3439s