HDU 3032 - Nim or not Nim?(SG)

ADRC学习与参数整定心得 ADRC,中文名是自抗扰控制技术。继承了经典PID控制器的精华,对被控对象的数学模型几乎没有任何要求,又在其基础上引入了基于现代控制理论的状态观测器技术,将抗干扰技术融入到了传统PID控制当中去,最终设计出了适合在工程实践中广泛应用的全新控制器。 1. ADRC介绍 ADRC主要跟踪微分器,非线性状态反馈(非线性组合),扩张观测器(ESO)三部分组成。 2. 跟踪微分器TD 2.1 作用 2.2 表达式 2.3 参数含义及作用 2.4 代码实现 2. 跟踪微分器TD 2.1 作用 最速跟踪微分器的作用是 阅读详情

Nim or not Nim?

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 587    Accepted Submission(s): 267


Problem Description
Nim is a two-player mathematic game of strategy in which players take turns removing objects from distinct heaps. On each turn, a player must remove at least one object, and may remove any number of objects provided they all come from the same heap.

Nim is usually played as a misere game, in which the player to take the last object loses. Nim can also be played as a normal play game, which means that the person who makes the last move (i.e., who takes the last object) wins. This is called normal play because most games follow this convention, even though Nim usually does not.

Alice and Bob is tired of playing Nim under the standard rule, so they make a difference by also allowing the player to separate one of the heaps into two smaller ones. That is, each turn the player may either remove any number of objects from a heap or separate a heap into two smaller ones, and the one who takes the last object wins.
 

Input
Input contains multiple test cases. The first line is an integer 1 ≤ T ≤ 100, the number of test cases. Each case begins with an integer N, indicating the number of the heaps, the next line contains N integers s[0], s[1], ...., s[N-1], representing heaps with s[0], s[1], ..., s[N-1] objects respectively.(1 ≤ N ≤ 10^6, 1 ≤ S[i] ≤ 2^31 - 1)
 

Output
For each test case, output a line which contains either "Alice" or "Bob", which is the winner of this game. Alice will play first. You may asume they never make mistakes.
 

Sample Input
2 3 2 2 3 2 3 3
 

Sample Output
Alice Bob
 


============================


SG打表

分堆处理:

 for(int i=1;i<=x/2;i++)  
    {  
        int ans=0;  
        ans^=dfs(i);  
        ans^=dfs(x-i);  
        visit[ans]=1;  
    } 


x -------- 0 1 2 3 4 5 6 7 8

g(x) ---- 0 1 2 4 3 5 6 8 7


#include <iostream>
#include <cstdio>

using namespace std;

int main()
{
    int t,n,s;
    scanf("%d",&t);
    while(t--)
    {
        int ans=0;
        scanf("%d",&n);
        for(int i=0;i<n;i++)
        {
            scanf("%d",&s);
            if(s%4==1||s%4==2)
            {
                ans^=s;
            }
            else
            if(s%4==3)
            {
                ans^=(s+1);
            }
            else
            {
                ans^=(s-1);
            }
        }
        if(ans)
            puts("Alice");
        else
            puts("Bob");
    }
    return 0;
}


[终于解决]Ubuntu14.04 32位安装移动网卡(0bda:b711)驱动8188gu tplink-WN726n 大致梳理一下问题解决的流程 首先,在台式机做了双系统,台式机只有一个网线接口,由于项目要求,需要占用网口传输数据,所以用之前买的tplink-WN726n免驱版2.0的移动网卡 【note】免驱版只能在Windows下安装使用,在Ubuntu系统中无法使用,所以,需要另辟蹊径。 找了很多资料,尝试很多方法,有的复杂有的简单,终于解决。 【思路】首先在Ubuntu系统中输入lsusb,查看是否检测到USB网卡设备。然后从Github中复制代码,构建,安装,然后modprobe一下,到前面那步还不行,就再来一步 阅读详情

相关推荐

用友YonSuite产品实操手把手教学(图文版)

用友YonSuite

ct341688的博客 8276

(HDU - 3032)Nim or not Nim?(尼姆博弈变形)

题目链接:Nim or not Nim? - HDU 3032 - Virtual Judge (ppsucxtt.cn) 题目大意:给你n堆石子,两个人轮流进行操作,每次可以从任意一堆中取走任意数量的石子,也可以将一堆石子分成两堆,最后无法操作者输。 这一看就是一个尼姆博弈的变形题目,尝试过后发现这道题目无法利用尼姆博弈本身的一些结论,我们只能利用sg函数进行求解,在求解sg函数时与尼姆博弈中求解sg函数过程差不多,就是多了一个分解操作,对于有n个石子的一堆石子,如果是一般的尼姆博弈的话,他的后继状态

AC__dream的博客 320

PS/2鼠标接口协议

一、PS/2鼠标接口        PS/2接口用于许多现代的鼠标和键盘,由IBM最初开发和使用。物理上的PS/2接口有两种类型的连接器:5脚的DIN和6脚的MINI-DIN。        二、鼠标的接口协议原理             PS/2鼠标接口采用一种双向同步串行协议。即每在时钟线上发一个脉冲,就在数据线上发送一位数据。但是在相互传输中 ,主机是拥有总线控制权的

Ant's home 1万+

ADRC学习笔记(二)

1.最速跟踪微分器TD 它的离散表达式为: 参数中:V(t)是目标值h、h0为积分步长,一般来说h可以等于h0,但是为了减少超调和减少震荡,才把他们分开,一般h0比h大,比如大20倍。当h0较大时,能够明显减少震荡,所以也叫滤波因子。减小h可以抑制噪声放大作用。r为速度因子,值越大,逼近速度越快,但是最好根据实际被控对象的可承受能力而定。 表达式中:其中fhan函数第一种表达式为: fhan函...

weixin_38291293的博客 1万+

我从华为身上学到的项目管理经验 -- 需求篇

记录这三年,关于项目管理上的一些心得体会 – 需求篇对于需求,我们可以根据不同的角色、理解拆分成三个过程:简单来说就是:需求分析原始需求、 需求拆分为系统需求、 需求实现为功能需求**需求分析**: 将客户需求 输出成 需求描述。 需求经理需要把 需求 转换成 客户能够接受的 初始需求 IR(Initial Requirement) 对于用户来说,我只管提 我的原始需求是

minminzhe520的博客 3万+

PLC编程标准之争:IEC61131与IEC61499核心区别与选型指南

在工业自动化领域,PLC编程长期依赖IEC61131标准,它定义了梯形图、结构化文本等语言,通过周期扫描机制保证确定性执行。然而,随着工业4.0和分布式控制场景的兴起,IEC61499以事件驱动模型打破传统范式,让功能块能跨设备协同,实现更灵活的柔性产线和模块化系统。理解两者在程序结构、数据交互、部署方式和实时性上的差异,是选型与工程落地的关键。本文从基础概念出发,剖析执行模型与架构演进,结合一线调试经验,帮助工程师在传统PLC与下一代标准之间做出理性决策。

weixin_27014595的博客 280

HDU-3032--Nim or not Nim?(博弈+SG打表)

题目分析: 这是一个经典的Multi-SG游戏的问题。 相较于普通的Nim游戏,该游戏仅仅是多了拆成两堆这样的一个状态。即多了一个SG(x+y)的过程。 而根据SG定理,SG(x+y)这个游戏的结果可以拆成SG(x)和 SG(y)游戏的结果的xor。 因此,在我们求SG函数的过程中,我们只需要再枚举一下拆成两堆的状态,即可获得Multi-SG游戏每个状态的SG函数。 但是题目中的数据范围较大(达...

橘嘉禾 100

Unity通用Buff系统,Buff编辑器(1,理论篇)(技能系统之Buff篇)

逻辑层根据游戏的规则和设计,控制Buff的生命周期、影响目标对象的属性或行为,以及处理Buff的交互和冲突。Buff堆叠和冲突:有些游戏中允许同类型的Buff叠加,以增加效果的强度,而有些游戏中可能不允许Buff叠加,只能由更强力的Buff来覆盖较弱的Buff。灵活个性化:每个游戏对象拥有自己的BuffManager,可以实现个体对象的独特Buff效果,增加游戏的多样性和个性化。自由控制:每个对象独立管理自己的Buff,可以自由地激活、更新和移除Buff效果,提供更精细的控制和逻辑实现。

u010082265的博客 4705

matlab常用函数

matlab常用函数数据统计函数当参数为向量时(1)y=max(X)(2)[y,k]=max(X)当参数为矩阵时,函数有三种调用格式:(1)max(A)(2)[Y,U]=max(A)(3)max(A,[],dim)(4) max(A(:))求矩阵的平均值和中值mean():求算术平均值。median():求中值。求和与求积sum():求和函数。prod():求积函数cumsum():累加和函数cumprod():累乘积函数标准差(1)std(X)(2)std(A)(3)std(A,flag,dim)相关系数

pythonsnail的博客 4289

Matlab:Matlab 软件学习之Matlab内置的各种系统的简介、案例应用(基于Simulink模糊控制仿真/二阶瞬态震荡电路案例)之详细攻略

选择左上角要编辑变量的图标,给定当前变量的论域Range,设置隶属函数类型type(八种隶属函数类型以供选择),最后选中某个隶属度函数(选中为红色),移动绘图区的每个隶属度函数的三个端点(竖向为权重)。(1)、首先在模糊规则编辑器左边选择一个输入变量,并选中它的一个语言值(隶属函数),然后编辑器右边选择一个输出变量,并选中它的一个语言值(隶属函数),然后将这种关系添加到模糊规则中。制定完成后,会形成模糊规则矩阵,系统会根据模糊输入量(如r1、r2),经过模糊规则(如45条),进而确定输出量(Y1、Y2)。

走向CTO之路 1133

YOLOv11改进 | 损失函数改进篇 | 2024最新高质量的目标检测边界框回归损失Unified-IoU、FocalUIoU、FocalInvUIoU(设置动态epoch参数)

本文给大家带来的改进机制是最近新提出的高质量的目标检测边界框回归损失,其通过动态调整模型对不同质量预测框的关注,优化目标检测中的边界框回归精度。UIoU引入了FocalBox方法,通过缩放预测框与真实框分配权重,并采用了退火策略(引入动态参数epoch),逐渐将模型的注意力从低质量预测框转移到高质量预测框,平衡了训练速度与检测精度。其还有一定的解决样本不平衡问题,同时该损失函数可以和现有的任何边界框回归损失函数进行结合,例如ShapeIoU和其结合可以形成二次创新,它是一种类似于之前的Inner的机制.

Snu77的博客 4608

HDU 3032 Nim or not Nim?(sg函数博弈)

题目地址:HDU 3032 这题是很好用来练习sg函数打表的一题。 下面是sg函数值打表代码: #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define LL long l

scf0920 1335

AIoT 在线工程实训平台案例——智能家居

AIoT 在线工程实训平台案例——智能家居的操作步骤

m0_53608652的博客 1441

HDU-3032Nim or not Nim?(SG打表)

题目传送门 Nim or not Nim? 题目大意 Alice和Bob做游戏,共有n堆石子,没堆石子为s[i]s[i]s[i]个,每一次可以从任意一堆中拿走任意个石子,也可以将一堆石子分为两个小堆。先拿完者获胜。 Alice先手 思路 用SG打表后 发现规律是 x=x−1 when (x%4==0)x=x-1\ when\ (x\%4==0)x=x−1 when (x%4==0) x=x+1 when (x%4==3)x=x+1\ when\ (

Kuricip的博客 209

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

HDU 3032 Nim or not Nim?(SG函数打表找规律)

Nim or not Nim? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2802    Accepted Submission(s): 1450   Problem Description Nim is a two-play...

shyoldman的博客 314

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

hdu3032 Nim or not Nim?(SG函数)

Nim or not Nim? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1710    Accepted Submission(s): 845 Problem Description Nim is a two-

随心丶而遇的博客 803

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

HDU 3032-Nim or not Nim?(sg函数打表)

Nim or not Nim? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1099    Accepted Submission(s): 547 Problem Description Nim is a tw

Rocky0429 1617

HDU 3032 Nim or not Nim?(SG函数)

Nim or not Nim?Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2564    Accepted Submission(s): 1335Problem DescriptionNim is a two-player mathem...

albertluf的博客 308

HDU3032 Nim or not Nim?(SG函数)

链接:http://acm.hdu.edu.cn/showproblem.php?pid=3032题意:n堆石子,每次可以从任意一堆中取走 若干个或者把一堆石子分成两小堆,拿到最后一个石子的获胜。问先手赢还是后手赢。思路:标题大坑,按照nim博弈的思路想了好久,最后发现根本不是nim博弈,,,打表跑出前一百个sg值之后发现了规律,如果一堆的石子数x对4取模得0,就亦或x-1;如果x对4取模得3,就亦

hcx11333的博客 296

hdu 3032 Nim or not Nim?(博弈 SG)

Nim is a two-player mathematic game of strategy in which players take turns removing objects from distinct heaps. On each turn, a player must remove at least one object, and may remove any number of o...

ling_wang的博客 291

hdu 3032 Nim or not Nim?(打表 sg函数)

Nim or not Nim? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 623    Accepted Submission(s): 288 Problem Description Nim is a

Dizzy的专栏 354

HDU 3032 Nim or not Nim?(博弈 SG打表找规律)

博弈SG函数 + 打表找规律

代码改变世界 1426

Nim or not Nim?(hdu3032+SG函数)取走-分割游戏,经典

Nim or not Nim? Description Nim is a two-player mathematic game of strategy in which players take turns removing objects from distinct heaps. On each turn, a player must remove at least one object, and may remove any number of objects provided they all com

寻找&星空の孩子 1732

hdu_oj3032Nim or not Nim?(Nim博弈变型+Mulit-SG)

这道题目很像Nim博弈,但是他与经典的Nim博弈相比,多了一个可以把任意一堆分成两堆的操作,然后问题似乎一下子就变得复杂没有思路起来了,既然想不出思路,又没有经典模型可以套用,那么我们就暴力一点,尝试用SG函数来打表,SG函数就可以解决几乎所有组合博弈的问题,那么我们试着分析一下相比于经典的Nim博弈新加的一种操作,就是将任意一堆分成两堆的操作,用SG函数来表示就是SG(X)=SG(X1+X2),而SG(X1+X2)可以用SG(X1)^SG(X2)解决,那么问题就迎刃而解了,直接枚举所有的状态,最后异...

_C9的博客 143

HDU 3032 Nim or not Nim?(博弈 sg表)

Nim or not Nim? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1326    Accepted Submission(s): 656 Problem Description Nim is a two-pl

左眼皮跳跳 381

HDU 3032 Nim or not Nim?(博弈,SG打表找规律)

Nim or not Nim? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 613    Accepted Submission(s): 282 Problem Description Nim is a two-player ma...

weixin_33853827的博客 114
上一篇: HDU 1538 - A Puzzle for Pirates(海盗分金)
下一篇: HDU 1848 - Fibonacci again and again(SG)
coco430
博客等级 码龄14年 9粉丝 107原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址