HDU - Hotel】的更多相关文章

Description The cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. Bessie, ever the competent travel agent, has named the Bullmoose Hotel on famed Cumberland Stree…
E - Tunnel Warfare HDU - 1540 对这个题目的思考:首先我们已经意识到这个是一个线段树,要利用线段树来解决问题,但是怎么解决呢,这个摧毁和重建的操作都很简单,但是这个查询怎么查呢, 这个是不是要判断这一个点左边和右边最远的距离,然后相加起来就可以了,所以就是维护一个区间最左边和最右边的值,然后把他们合并就是最大值. 这个最左边的值 pre_max = 子左节点的 pre_max 如果这个 pre_max==len 那就可以合并子右节点的 pre_max 最右值同理 这个…
http://acm.hdu.edu.cn/showproblem.php?pid=2992 #include <cstdio> #include <cstring> #include <map> #include <vector> #include <queue> #define maxn 200 #include <algorithm> using namespace std; const int inf=0x3fffffff;…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2585 题目大意:马克思要找个曾经去过的很好的旅馆,可惜他记不完整旅馆的名字.他有已知的部分信息和可能的旅馆全称,输出匹配的旅馆名个数.已知信息中‘*’代表此处为0或多个小写字母,‘?’代表此处仅有一个小字母. 代码如下 //匹配字符串递归 #include<iostream> #include<string> using namespace std; bool find(string…
Problem Description Last year summer Max traveled to California for his vacation. He had a great time there: took many photos, visited famous universities, enjoyed beautiful beaches and tasted various delicious foods. It is such a good trip that Max…
Summer again! Flynn is ready for another tour around. Since the tour would take three or more days, it is important to find a hotel that meets for a reasonable price and gets as near as possible! But there are so many of them! Flynn gets tired to loo…
点我看题目 题意 : 一个司机要从1点到达n点,1点到n点中有一些点有宾馆,司机的最长开车时间不能超过10小时,所以要在10小时之内找到宾馆休息,但是为了尽快的走到n点,问最少可以经过几个宾馆. 思路 : 这个题太狠了,简直不是人做的....可以BFS一下,然后在B之前先D一下能走的路.当然也可以用SPFA+Floyd. #include <stdio.h> #include <string.h> #include <iostream> #include <que…
题意: 有n个旅馆,从这n个旅馆中找出若干个旅馆,使得这若干个旅馆满足这样的条件:不能从其它和剩下的旅馆中找到一个价格和距离都小于这个旅馆的旅馆... 解析: 按price 排序,若price相同, 则按距离排序 然后遍历每一个旅馆,在处理当前 旅馆时,二分在price小于当前旅馆price的旅馆中 找到最后一个price小于当前旅馆price的旅馆(因为可能price相同) 然后rmq求距离最小值就可 #include <iostream> #include <cstdio> #…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5992 题目链接:https://www.nowcoder.com/acm/contest/207/K Problem DescriptionThere are N hotels all over the world. Each hotel has a location and a price. M guests want to find a hotel with an acceptable pric…
Find the hotel Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 767    Accepted Submission(s): 263 Problem Description   Summer again! Flynn is ready for another tour around. Since the tour would…