题目链接:hdu 4932 Miaomiao's Geometry
题目大意:在x坐标上又若干个点,现在要用若干条相等长度的线段覆盖这些点,若一个点被一条线段覆盖,则必须在这条线的左端点或者是右端点,并且各个线段放的位置不能又重叠,求最大长度。
解题思路:这题有坑点,比赛的时候o(n)的算法去寻找两点之间最短距离。但起始这样是不行的,比如-1 0 10 12 18 20,这样维护过去的...
分类:
其他好文 时间:
2014-08-11 00:23:31
阅读次数:
248
CrackingtheSafeTime Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:65536KBTotal submit users:46, Accepted users: 12Problem 12886 : No special ...
分类:
其他好文 时间:
2014-08-10 23:54:31
阅读次数:
414
题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12886&courseid=274解题报告:输入4个数,要你判断用 + 、- 、 * 、/、四种运算能不能得到一个结果为24的式子,可以用括号。解释一下测试的第四组样例:应该是6 ...
分类:
其他好文 时间:
2014-08-10 23:49:11
阅读次数:
383
经典的一个题,今天竟然写跪了……题意: 给你4个数字,让你判断是否能通过四则运算和括号,凑成24点。思路: 暴力枚举运算顺序和运算符。代码: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #incl...
分类:
其他好文 时间:
2014-08-10 21:24:50
阅读次数:
296
题意:不解释。
策略:广搜。
解释一下为什么会是广搜,一个水杯只能向其他两个水杯倒水,不能向他自己倒水,这样一共有三个水杯也就是有6种情况,只需要一步一步的着就好了(数据没多大《100), 我们将每一次出现的水杯中的水数(就是有多少水)都标记下来,如果是以前没有出现过,那么就进队列,同时将此时的水杯数标记下来,说明该种情况已出现,一直找到想要找的状态为止,如果都找不到,就返回-1.
难点:我...
分类:
其他好文 时间:
2014-08-10 10:28:40
阅读次数:
211
QuiteGoodNumbersTime Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:65536KBTotal submit users: 77, Accepted users: 57Problem 12876 : No specia...
分类:
其他好文 时间:
2014-08-10 01:30:09
阅读次数:
368
字符串搜索 可以暴力搜 主要是代码要精简点 参考了网上的代码优化后写出来的ac代码 1 #include 2 #include 3 #include 4 using namespace std; 5 int m,n; 6 int positionx; 7 int positiony; 8 char ...
分类:
其他好文 时间:
2014-08-09 23:12:59
阅读次数:
330
Hangman Judge
In ``Hangman Judge,'' you are to write a program that judges a series of Hangman games. For each game, the answer to the puzzle is given as well as the guesses. Rules are t...
分类:
其他好文 时间:
2014-08-09 21:37:19
阅读次数:
414
Where's Waldorf?
Given a m by n grid
of letters, ( ),
and a list of words, find the location in the grid at which the word can be found. A word matches a straight, uninterrupted line o...
分类:
其他好文 时间:
2014-08-09 18:42:38
阅读次数:
370
这道题我的做法就是枚举这四个数的所有排列所有运算所有计算顺序。略有考验代码能力,不能漏掉情况,注意模块化的思想,一些功能写成函数调试的时候结构清晰好分析。比赛时没有AC是对next_permutation()函数理解的不透,根本没有想到是没有从最小字典序开始枚举的问题。就是next_permutat...
分类:
其他好文 时间:
2014-08-09 00:07:26
阅读次数:
278