题目链接:uva 1378 - A Funny Stone Game
题目大意;两个人玩游戏,对于一个序列,轮流操作,每次选中序列中的i,j,k三个位置要求ij≤k,然后arr[i]减1,相应的arr[j]和arr[k]加1,不能操作的人输,问先手是否必胜,必胜的话给出字典序最下的必胜方案,负责输出-1.
解题思路:首先预处理出各个位置上的SG值,然后对于给定序列,枚举位置转移状态后判...
分类:
其他好文 时间:
2014-08-09 00:20:07
阅读次数:
352
题目链接:uva 11249 - Game
题目大意:给定K和N,表示有N轮游戏,每轮游戏给定两堆石子的个数,两人轮流操作,每次操作可以选择一堆取任意数量的石子,也可以选两堆取,要求两堆取的石子数之差的绝对值小于K,不能操作者为输,问先手的胜负情况。
解题思路:傻逼先手才一次取完,那样的话对手直接将另一堆取光不就傻逼了。所以先手就有一个取石子的最优策略,当两堆石子的数量差小于等K的时候...
分类:
其他好文 时间:
2014-08-09 00:17:36
阅读次数:
340
Bob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by areas, in whi...
分类:
其他好文 时间:
2014-08-08 23:51:16
阅读次数:
315
//两人取硬币游戏 hard coins gameint solve(){ int win[MAX]; //定义轮到自己,当剩下j个时为必胜OR必败态/****j=0时,必败。对于某个a[i], j-a[i]为(对手)必败态,则 j 个时自己可以有必胜态对于任意a[i], j-a[i]为...
分类:
其他好文 时间:
2014-08-08 23:44:26
阅读次数:
304
Survival
Time Limit: 5 Seconds
Memory Limit: 32768 KB
The King of Fighter 97 (KOF97) is an electronic game of wrestling type. Once it was fashionable among youths. The game is amused. However...
分类:
其他好文 时间:
2014-08-08 21:27:46
阅读次数:
327
Problem Description
Fighting the Landlords is a card game which has been a heat for years in China. The game goes with the 54 poker cards for 3 players, where the “Landlord” has 20 cards and the ot...
分类:
其他好文 时间:
2014-08-08 16:04:46
阅读次数:
204
Idiomatic Phrases Game
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 2033 Accepted Submission(s): 663
Problem Description
Tom ...
分类:
其他好文 时间:
2014-08-08 12:57:56
阅读次数:
239
解题报告
题意:
略
思路:
单点更新,区间乘积。
#include
#include
#include
#define LL long long
using namespace std;
LL mul[501000];
void update(int root,int l,int r,int p,int v)
{
int mid=(l+r)/2;
if(l==r)...
分类:
其他好文 时间:
2014-08-08 08:29:05
阅读次数:
239
Jump Game IIGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents...
分类:
其他好文 时间:
2014-08-08 01:51:45
阅读次数:
214
Fighting the LandlordsProblem DescriptionFighting the Landlords is a card game which has been a heat for years in China. The game goes with the 54 pok...
分类:
其他好文 时间:
2014-08-07 21:47:30
阅读次数:
408