A New Stone GameTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 4177Accepted: 2227DescriptionAlice and Bob decide to play a new stone game.At...
分类:
其他好文 时间:
2014-09-16 02:41:29
阅读次数:
280
题目地址:POJ 1704
这个题实在巧妙。。居然这样就可以转化成了经典的nim模型。
这题可以从左往右两两配对,如果是奇数个的话,就让最左边的与0配对。然后每当对方移动某一对的前一个,你总可以移动该对的后一个来移动回来。所以这是没有影响的。有影响的只是每一对中间的空格数。这就转化成了((n+1)/2)堆石子的游戏,每一堆的石子个数是每一对点之间的空格数。然后用异或求解。
代码如下:
#i...
分类:
其他好文 时间:
2014-09-15 22:56:19
阅读次数:
270
找规律....
Abs Problem
Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge
Alice and Bob is playing a game, and this time the game is all about the absolute value!
Alice ...
分类:
其他好文 时间:
2014-09-11 22:28:12
阅读次数:
233
CARDSTime Limit:1000MSMemory Limit:10000KTotal Submissions:1448Accepted:773DescriptionAlice and Bob have a set of N cards labelled with numbers 1 ... ...
分类:
其他好文 时间:
2014-09-11 22:07:02
阅读次数:
183
he Himalayas
Time Limit: 2 Seconds Memory Limit: 65536 KB
As an artist, Bob usually need to travel around the world. He made a lot of sketch of scenery on his journey. A famous spot he ha...
分类:
其他好文 时间:
2014-09-09 12:48:18
阅读次数:
214
The 2014 ACM-ICPC Asia Mudanjiang Regional First Round - AThe HimalayasTime Limit: 2 Seconds Memory Limit: 65536 KBAs an artist, Bob usually need to t...
分类:
其他好文 时间:
2014-09-09 11:42:28
阅读次数:
332
【A】The HimalayasTime Limit: 2 Seconds Memory Limit: 65536 KBAs an artist, Bob usually need to travel around the world. He made a lot of sketch of s...
分类:
其他好文 时间:
2014-09-09 10:30:58
阅读次数:
230
题目链接题意:如图,Georgia和Bob在玩游戏。一个无限长的棋盘上有N个旗子,第i个棋子的位置可以用Pi表示。现在Georgia先走。每个人每一次可以把一枚棋子向左移动任意个格子,但是不能超越其他棋子,也不能和其他棋子处在同一个格子里。如果轮到某一个人的时候Ta再也不能移动棋子了,就判负。现在每...
分类:
其他好文 时间:
2014-09-08 00:57:36
阅读次数:
342
在很多语言中都有映射这种结构,而字典是Python中唯一内建的映射类型。
下面来看一个字典的例子:
phonebook = {'Alice':'2341', 'Beth':'9102', 'Cecil':'3258'}
名字是键,号码是值,二者之间用冒号隔开,字典中键是唯一的,值并不唯一。空字典由两个大括号组成:{}。再介绍几个常用的字典操作:
len(d) 返回d中键值对的数目d...
分类:
编程语言 时间:
2014-09-07 17:21:45
阅读次数:
195