Description You are the manager of a small soccer team. After seeing the shameless behavior of your team during the match, you are mad at all of the current players. Therefore, you have made a huge decision: put these players on the substitution benc…
第一次玩ACM...有点小紧张小兴奋.这题目好难啊,只是网赛就这么难...只把最简单的两题做出来了. 题目1: 代码: //#define _ACM_ #include<iostream> #include<cstring> #include<string> #include<vector> #include<map> #include<set> using namespace std; char line[111], word[11…
HDU 4046 Panda (ACM ICPC 2011北京赛区网络赛) Panda Time Limit: 10000/4000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1816    Accepted Submission(s): 632 Problem Description When I wrote down this letter, you may have…
题意就是说1-N个城市为一个环,最开始你手里有C块钱,问从1->N这些城市中,选择任意一个,然后按照顺序绕环一圈,进入每个城市会有a[i]元钱,出来每个城市会有b[i]个城市,问是否能保证经过每个城市,钱都不会能为0,如果可以请输出最小的那个 这题最开始队员想错了...后来思路就乱了,整理一下思路,你会发现,其实我们要求的就是从i到n+i的前缀和最小值一定要大于c. 那么如何解决这个问题呢??? 你会发现,其实我们只需要算一个影响就行,假如最小的点的在ID,那么前面i->ID的数肯定小,对吧?…
题意:n个城市,初始能量c,进入i城市获得a[i]能量,可能负数,去i+1个城市失去b[i]能量,问你能不能完整走一圈. 思路:也就是走的路上能量不能小于0,尺取维护l,r指针,l代表出发点,r代表当前走到的点,维护一个sum.和工程的题一模一样啊. 代码: #include<set> #include<map> #include<stack> #include<cmath> #include<queue> #include<vector&…
时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 Lara Croft, the fiercely independent daughter of a missing adventurer, must push herself beyond her limits when she discovers the island where her father disappeared. In this mysterious island, Lara finds a tomb…
题意:到一个城市得钱,离开要花钱.开始时有现金.城市是环形的,问从哪个开始,能在途中任意时刻金钱>=0; 一个开始指针i,一个结尾指针j.指示一个区间.如果符合条件++j,并将收益加入sum中(收益可能是负数).不符合就++i,并从sum中退掉收益直到sum>=0;区间长度为n时i的位置就是结果. 正确性证明:假设[a,b]是第一个合法区间.某时刻i,j都<a,i在a左边,因此j不可能扩到b右边(否则[a,b]不是第一个合法区间).只可能j仍落在a左边,或者落到a,b中间.在i<a…
水道题目,比赛时线段树写挫了,忘了RMQ这个东西了(捞) #1831 : 80 Days 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 80 Days is an interesting game based on Jules Verne's science fiction "Around the World in Eighty Days". In this game, you have to manage the limited money and ti…
任意门:http://hihocoder.com/problemset/problem/1828 Saving Tang Monk II 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 <Journey to the West>(also <Monkey>) is one of the Four Great Classical Novels of Chinese literature. It was written by Wu Cheng'en duri…
任意门:http://hihocoder.com/problemset/problem/1829 Tomb Raider 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 Lara Croft, the fiercely independent daughter of a missing adventurer, must push herself beyond her limits when she discovers the island where her fath…