Description
You and your friend are playing a game in which you and your friend take turns removing stones from piles. Initially there are N piles witha1, a2, a3,..., aN number
of stones. On ...
分类:
其他好文 时间:
2015-06-10 14:14:53
阅读次数:
114
这是应读者要求写的一篇综合图书推荐文章,关于Linux的。图灵Linux经典书自然不少,另外,新出版的ARM,林纳斯大神的传纪,也深受读者欢迎。这次总结了每本书的优缺点,希望大家能找到真正适合自己阅读的书。1. 《Linux程序设计(第4版)》(经典入门书)原书名:Beginning Linux Programming
作者:Neil Matthew, Richard Stones
译者:宋健建...
分类:
系统相关 时间:
2015-05-14 12:02:01
阅读次数:
230
Let's play a traditional game Nim. You and I are seated across a table and we have a hundred stones on the table (we know the number of stones exactly...
分类:
其他好文 时间:
2015-04-29 21:06:13
阅读次数:
180
题意:sempr走在路上会遇见一些石头,如果遇见第奇数个石子,则将它扔到前面,如果是偶数,则什么也不做,如果某一个位置上有多个石头,则先遇见扔的比较近的那个,现在给出一些石头的初始位置和能够扔的距离,问到最后最远处的石头离初始位置多远!
简单的优先队列
#include
#include
#include
using namespace std;
int n;
struct stu
{
in...
分类:
其他好文 时间:
2015-04-22 15:22:06
阅读次数:
140
Nim is a 2-player game featuring several piles of stones. Players alternate turns, and on his/her turn, a player’s move consists of removing one or more stones from any single pile. Play ends when all the stones have been removed, at which point the last p...
分类:
其他好文 时间:
2015-04-01 15:21:45
阅读次数:
197
Problem Description
Agrael likes play a simple game with his friend Animal during the classes. In this Game there are n piles of stones numbered from 1 to n, the 1st pile has M1 stones, the 2nd pile has M2 stones, ... and the n-th pile contain Mn stones. A...
分类:
其他好文 时间:
2015-03-30 16:33:51
阅读次数:
141
源引自己的github.iohttp://awarrior.github.io/pick-stone/DescribeTwo players would like to pick up some from one heap of stones. Assume the quantity of ston...
分类:
其他好文 时间:
2015-03-30 12:53:31
阅读次数:
138
1.nimNimTime Limit:1000MSMemory Limit:65536KTotal Submissions:4996Accepted:2311DescriptionNim is a 2-player game featuring several piles of stones. Pl...
分类:
其他好文 时间:
2015-03-30 09:10:52
阅读次数:
196
题意:有n堆石子,两个人轮流取,每次只能取一堆的至少一个至多一半石子,直到不能取为止。判断先手是否必胜。分析:本题的关键就是求SG函数,可是直接分析又不太好分析,于是乎找规律。经过一番“巧妙”的分析,有这样一个规律:如果n是偶数,SG(n) = n / 2;如果n是奇数,SG(n) = SG(n /...
分类:
其他好文 时间:
2015-03-09 19:01:56
阅读次数:
131