题意:多组数据,每组数据一个先n,然后给出n堆石子的数目。
两人轮流操作,每次可以从某数量为xi的石子堆中扔掉k个石子(k∈[1,xi]),然后剩余xi-k个,可以把g个石子随意分给其他堆(不能凭空建堆出来,g∈(0,xi-k))。
题解:
首先构造平衡状态:
有偶数堆,且可以两两配对。
这样可以理解为先手玩一下,后手可以有同样的应对策略。(脑洞开一下就好了,这不是难点少年)
...
分类:
其他好文 时间:
2015-01-10 18:18:22
阅读次数:
145
Problem Description
There are a bunch of stones on the beach; Stone color is white or black. Little Sheep has a magic brush, she can change the color of a continuous stone, black to white, white to...
分类:
其他好文 时间:
2015-01-09 23:50:47
阅读次数:
468
Given a linked list, remove the nth node from the end of list and return its head.
For example,
Given linked list: 1->2->3->4->5, and n = 2.
After removing the second node from the end, the...
分类:
其他好文 时间:
2015-01-09 09:17:50
阅读次数:
165
Abstract. To provide the precision required in industrial design, drawings need to offer the possibility of removing lines, which are hidden in a give...
分类:
其他好文 时间:
2015-01-05 20:18:49
阅读次数:
266
美术部分: 3d模型,材质,纹理,shader,Animator,Animation,天空盒,灯光效果,烘焙程序部分: 基本组成: Scene场景:用于摆放各种游戏对象。 GameObject:可以携带各种Compoment Compoment:附加在Gam...
分类:
编程语言 时间:
2015-01-03 14:40:15
阅读次数:
216
Given a linked list, remove the nth node from the end of list and return its head.
For example,
Given linked list: 1->2->3->4->5, and n = 2.
After removing the second node from the end, the...
分类:
其他好文 时间:
2015-01-02 09:47:12
阅读次数:
112
目前进展:
封装蛇的移动方法:
typedef struct snakeinfo
{
int numParts;/* how many parts,蛇身体分多少个段 */
int lenParts[GAME_WIDTH];/* 蛇身体每段的长度 */
int xPartsHead[GAME_WIDTH];/* 蛇身体第i段的x坐标,初始值为1 */
int yPartsHead[GAM...
分类:
移动开发 时间:
2014-12-28 20:56:56
阅读次数:
152
这次的目的,是打造一个全功能机,预装Rosetta Stone、Supememo软件学习,能处理office文档,能当mp3播放机,能看电影能上网,能当电子书阅读器(还要能读),玩游戏当然也能满足要求。Dell venue 8 pro显然是性价比最好的Win8小平板,国货想自强还任重道远。...
分类:
其他好文 时间:
2014-12-28 14:14:21
阅读次数:
328
A - Removing Columns
贪心。
只能是竖着不递减的就尽量选上,当某一行出现字典序大于上一行的情况的时候,就不用再考虑这一行。
代码如下:
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
char s[1002][1002...
分类:
其他好文 时间:
2014-12-27 11:25:03
阅读次数:
143
Given a linked list, remove the nth node from the end of list and return its head.
For example,
Given linked list: 1->2->3->4->5, and n = 2.
After removing the second node from the end, the l...
分类:
其他好文 时间:
2014-12-24 18:05:07
阅读次数:
152