一下两个题目都是按堆取石子,轮流取,每个人都贪心的取即可,感觉都不像博弈. CF388C 有n排石子,每排有若干堆.Ciel可以选择一排,拿走这一排的第一堆石子.Jiro可以选择一排,拿走这一排的最后一堆石子.两个人都想要让自己的石子数量最多.问两个人最后的石子数量.Ciel先手. 分析: 先考虑Ciel,他肯定可以保证自己至少得到每排石子的左半边.只要按照下面的原则做就可以: 第一个石子先随便选,如果Jiro和自己拿同一排,那就随便再选一个.如果Jiro没和自己拿同一排,那就去和Ciel拿同一…
题意:中文...你们懂得. 析:这个就是一个水题博弈,就是一个巴什博弈定理,直接就没有变,如果你们看过我写的那个,这个题绝对水过. 附地址:http://www.cnblogs.com/dwtfukgv/p/5517818.html 看完后就懂了吧,不用说了,直接上代码就OK. 代码如下: #include <iostream> #include <string> #include <vector> #include <algorithm> #include…
11.9 线段树 http://acm.hdu.edu.cn/showproblem.php?pid=6315 求逆序对个数 http://acm.hdu.edu.cn/showproblem.php?pid=6318 必赢博弈 http://acm.hdu.edu.cn/showproblem.php?pid=6312 欧拉回路 http://acm.hdu.edu.cn/showproblem.php?pid=6311 好难的构造题目 http://acm.hdu.edu.cn/showpr…
n a^o7 ! Time Limit: 1000MS Memory limit: 65536K 题目描述 All brave and intelligent fighters, next you will step into a distinctive battleground which is full of sweet and happiness. If you want to win the battle, you must do warm-up according to my inst…
Identifiers Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述  Identifier is an important concept in the C programming language. Identifiers provide names for several language elements, such as functions, variables, labels, etc. An identifie…
Zhuge Liang's Password Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 59    Accepted Submission(s): 47 Problem Description In the ancient three kingdom period, Zhuge Liang was the most famous a…
Shopping Time Limit: 1000MS Memory limit: 65536K 题目描述 Saya and Kudo go shopping together.You can assume the street as a straight line, while the shops are some points on the line.They park their car at the leftmost shop, visit all the shops from left…
lightoj 1020 A Childhood Game 链接:http://lightoj.com/volume_showproblem.php?problem=1020 题意:一堆石子有 m 个,Alice和Bob可以从中取1个或者2个,如果Alice先取,最后取的人败:如果Bob先取,最后取的人胜.问胜利者. 思路:枚举前几个石子的情况,很容易找出每种情况的必败点,找规律.如果Alice先取,Alice的必败点为mod 3 == 1,如果Bob先取,Bob必败点在 mod 3 == 0处…
哈哈哈哈哈哈哈,最近一直在补题,改各种错误的代码,wa了20多遍,改到心态爆炸,改好之后,感觉世界都美好了(叉会腰~)... A. Who is the winner? time limit per test 1 second memory limit per test 64 megabytes input standard input output standard output A big marathon is held on Al-Maza Road, Damascus. Runners…
Hello World! Time Limit: 1000MS Memory limit: 65536K 题目描述 We know that Ivan gives Saya three problems to solve (Problem F), and this is the first problem.“We need a programmer to help us for some projects. If you show us that you or one of your frien…
题目链接:http://codeforces.com/problemset/problem/939/A A题 A. Love Triangle time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output As you could know there are no male planes nor female planes. However…
求最短时间和最长时间. 当两个蚂蚁相遇的时候,可以看做两个蚂蚁穿过,对结果没有影响.O(N)的复杂度 c++版: #include <cstdio> #define min(a, b) (a) < (b) ? (a) : (b) #define max(a, b) (a) > (b) ? (a) : (b) int main(void) { #ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin);…
题意:linji的仓鼠丢了,他要找回仓鼠,他在房间0放了一块奶酪,按照抓鼠手册所说,这块奶酪可以吸引距离它D的仓鼠,但是仓鼠还是没有出现,现在给出一张关系图,表示各个房间的关系,相邻房间距离为1,而且图中没有回路,每个房间都是联通的,求仓鼠可能出现的房间的数量. 很容易的dfs,50000个房间数据量比较大,用数组难以保存,于是用vector储存关系表.遍历过去,遍历过几个房间,那剩下的就是仓鼠可能出现的房间数了. 代码: /* * Author: illuz <iilluzen[at]gmai…
题意:给出一个偶数(不论正负),求出两个素数a,b,能够满足 a-b=x,素数在1e6以内. 只要用筛选法打出素数表,枚举查询下就行了. 我用set储存素数,然后遍历set里面的元素,查询+x后是否还是素数. 注意,偶数有可能是负数,其实负数就是将它正数时的结果颠倒就行了. 代码: /* * Author: illuz <iilluzen[at]gmail.com> * Blog: http://blog.csdn.net/hcbbt * File: 10.cpp * Create Date:…
Problem Description Professor Zhang has a number sequence a1,a2,...,an. However, the sequence is not complete and some elements are missing. Fortunately, Professor Zhang remembers some properties of the sequence:1. For every i∈{1,2,...,n}, 0≤ai≤100.2…
Problem Description Professor Zhang has kinds of characters and the quantity of the i-th character is ai. Professor Zhang wants to use all the characters build several palindromic strings. He also wants to maximize the length of the shortest palindro…
没什么好说的 #include<iostream> using namespace std; ], x, y,n, m, ans; int main(){ cin>>n>>m; ;i<=n;++i){ cin>>x>>y; a[x]++; --a[y+]; } ;i<=;++i) a[i]+=a[i-]; ;i<=m;++i) )ans++; cout<<ans<<endl; ;i<=m;++i)…
给出一个有N个数的序列,编号0 - N - 1.进行Q次查询,查询编号i至j的所有数中,最大的数是多少.   例如: 1 7 6 3 1.i = 1, j = 3,对应的数为7 6 3,最大的数为7.(该问题也被称为RMQ问题) Input第1行:1个数N,表示序列的长度.(2 <= N <= 10000) 第2 - N + 1行:每行1个数,对应序列中的元素.(0 <= Sii <= 10^9) 第N + 2行:1个数Q,表示查询的数量.(2 <= Q <= 1000…
  C    HDU_5578 求字符串中所有相同字母的最小距离H. Input 实例个数T然后T行字符串字符串中仅含有小写字母.1≤T≤501≤len≤1000(len为字符串长度) Output 对于每个实例输出Case #t: H,表示第t个实例的答案是H. 如果没有相同的字母,H=-1. Sample Input 2 ac wxzayzxw Sample Output Case #1: -1 Case #2: 3 纯模拟_两层循环 #include <iostream> #includ…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2602 水题啊水题 还给我WA了好多次 因为我在j<w[i]的时候状态没有下传.. #include <cstdio> #include <algorithm> #include <cstring> using namespace std; typedef long long LL; typedef pair<int,int> PII; #define PB…
A. Checking the Calendar 题目连接: http://codeforces.com/contest/724/problem/A Description You are given names of two days of the week. Please, determine whether it is possible that during some non-leap year the first day of some month was equal to the f…
A. Uncowed Forces Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/604/problem/A Description Kevin Sun has just finished competing in Codeforces Round #334! The round was 120 minutes long and featured five problems with maxi…
BiliBili, ACFun… And More! Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Some of you may have already noticed, there is a team in our final contest whose name is UESTC_BiliBilii, with user id as ACfun. Actually,…
转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Hiking Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 724    Accepted Submission(s): 384Special Judge Problem Description There are …
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight Moves1101 Gamblers1204 Additive equations 1221 Risk1230 Legendary Pokemon1249 Pushing Boxes 1364 Machine Schedule1368 BOAT1406 Jungle Roads1411 Annive…
一.Description A certain prison contains a long hall of n cells, each right next to each other. Each cell has a prisoner in it, and each cell is locked. One night, the jailer gets bored and decides to play a game. For round 1 of the game, he takes a d…
一.Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In order for him to survive, he decided to create one of the first ciphers. This cipher was so incredibly sound, th…
题目链接: B. Inventory time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Companies always have a lot of equipment, furniture and other things. All of them should be tracked. To do this, there is…
看大佬做2017-WF,我这种菜鸡,只能刷刷水题,勉强维持生活. 赛后补补水题. 题目pdf链接,中文的,tls翻译的,链接在这里 个人喜欢在vjudge上面刷题. E Need for Speed 题意: 有中文题意,我就不多说了,仪表盘会有一个固定偏差,求这个. 思路: 二分答案,进行判断,二分的上下限,我是 -1 到 1e8:一开始范围错了WA掉了. #include <stdio.h> #include <iostream> #include <algorithm&g…
题目链接: Summary Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others) Problem Description   Small W is playing a summary game. Firstly, He takes N numbers. Secondly he takes out every pair of them and add this two numbers…