Problem DescriptionThere 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 o...
分类:
其他好文 时间:
2014-08-20 12:11:22
阅读次数:
209
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 with a1,
a2, a3,..., aN number of stones. On eac...
分类:
其他好文 时间:
2014-08-17 11:46:42
阅读次数:
172
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4573Problem Description Remember our childhood? A few naked children throw stones standing on the same....
分类:
其他好文 时间:
2014-08-14 14:01:08
阅读次数:
226
题目链接: uva 1482 - Playing With Stones
题目大意:n堆石子,给定每堆石子的个数,两个人分别从操作,每次可以从一堆中取走至少一个石子,但是不能超过一半。如果不能操作则视为失败。
解题思路:对于每一堆式子来说,可以看作一个Nim游戏,但是SG(x)并不等于x,因为每次取石子不能超过一半,所以对于偶数SG(x)=x/2,对于奇数SG(x)=SG(x/2).
...
分类:
其他好文 时间:
2014-08-06 01:59:40
阅读次数:
251
题意:给n个石头,分成一些部分(最多n部分,随便分),问分完后每部分的数量的乘积有多少种情况。分析:可以看出,其实每个乘积都可以分解为素数的乘积,比如乘积为4,虽然可以分解为4*1,但是更可以分解为2*2*1,所以就可以枚举素因子来分解,dfs即可。代码:#include #include #inc...
分类:
其他好文 时间:
2014-08-05 21:56:00
阅读次数:
252
//next_permutation全排列
# include
# include
# include
using namespace std;
struct node
{
int w;
int v;
};
struct node a[10010];
int max1(int x,int y)
{
return x>y?x:y;
}
int main()
{
int i,n,d,fl...
分类:
其他好文 时间:
2014-08-04 21:33:18
阅读次数:
279
Dividing Stones
Time limit:
7s
Source limit:
50000B
Memory limit:
256MB
There are N stones, which can be divided into some piles arbitrarily. Let the v...
分类:
其他好文 时间:
2014-08-01 19:42:12
阅读次数:
261
A Famous Stone Collector
Problem Description
Mr. B loves to play with colorful stones. There are n colors of stones in his collection. Two stones with the same color are indistinguishable. M...
分类:
其他好文 时间:
2014-07-30 17:41:44
阅读次数:
287
Luke Skywalker is having exhausting practice at a God-forsaken planet Dagoba. One of his main difficulties is navigating cumbersome objects using the Power. Luke’s task is to hold several stones in
...
分类:
其他好文 时间:
2014-07-29 13:15:57
阅读次数:
326
# include
# include
# include
using namespace std;
struct node
{
int pos;
int d;
int num;
friend bool operator n2.d;//仍的距离从小到大
return...
分类:
其他好文 时间:
2014-07-21 11:43:44
阅读次数:
180