上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 32 下一页
摘要: 2014-07-2320:48:32Problem BNumber SequenceInput:standard inputOutput:standard outputTime Limit:1 secondA single positive integeriis given. Write a pro... 阅读全文
posted @ 2014-07-23 20:49 Naturain 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 2014-07-2320:45:03Problem CA mid-summer night’s dreamInput:standard inputOutput:standard outputThis is year 2200AD. Science has progressed a lot in tw... 阅读全文
posted @ 2014-07-23 20:47 Naturain 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 2014-07-2320:42:12Problem FSolve ItInput:standard inputOutput:standard outputTime Limit:1 secondMemory Limit: 32 MBSolve the equation:p*e-x+q*sin(x) +... 阅读全文
posted @ 2014-07-23 20:43 Naturain 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 2014-07-2119:30:21DEL commandIt is required to find out whether it is possible to delete given files from MS-DOS directory executing the DEL command o... 阅读全文
posted @ 2014-07-21 19:34 Naturain 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 2014-07-2021:00:37Puzzle (II)Little Barborka has just started to learn how to solve a picture puzzle. She has started with a small one containing 15 p... 阅读全文
posted @ 2014-07-20 21:27 Naturain 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 2014-07-2014:55:02A Puzzling ProblemThe goal of this problem is to write a program which will take from 1 to 5 puzzle pieces such as those shown below... 阅读全文
posted @ 2014-07-20 15:21 Naturain 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 2014-07-2011:55:19HexagonConsider a game board consisting of 19 hexagonal fields, as shown in the figure below. We can easily distinguish three main d... 阅读全文
posted @ 2014-07-20 12:04 Naturain 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 2014-07-1923:49:21Problem A - No TippingAs Archimedes famously observed, if you put an object on a lever arm, it will exert a twisting force around th... 阅读全文
posted @ 2014-07-20 00:04 Naturain 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 2014-07-1921:06:13题目: Addition ChainsAn addition chain for n is an integer sequence with the following four properties:a0 = 1am = na0 and are both v... 阅读全文
posted @ 2014-07-19 21:13 Naturain 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 2014-07-1920:54:33思路:枚举每个topping,放或不放,要注意Dfs之后要还原数据(不知道自己写的还原有没有点多余的部分)。主要剪枝:先记录每个人的所有需求中的最大字母Ki(如:+H+I+C; 的最大字母是I),当递归到第cur个字母时,搜索所有人,如果某个人的需求未被至少满足一... 阅读全文
posted @ 2014-07-19 21:06 Naturain 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 2014-07-1914:52:09题意&思路:(1)先把罗马数字转化为阿拉伯数字,判断等式是否成立以确定是 Correct 还是 Incorrect。具体转化方法借鉴了别人:定义两个pointer:i,j,从罗马数字(字符串)的末尾开始扫,以罗马数字末尾的数字为初始值,i初始在末尾,j 初始在 i... 阅读全文
posted @ 2014-07-19 15:04 Naturain 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 2014-07-1817:10:26题意:也算是一个经典的回溯问题。题意不再赘述,来讲讲剪枝:(1)首先采用邻接表的方式保存图的信息,并对每个点的表进行从大到小的排序。(因为是从第一个点开始DFS,从大到小排序可以使优先考虑后面的点,避免每次都遍历已经考虑的点,以增加效率)(2)如果当前设立的St数... 阅读全文
posted @ 2014-07-18 17:30 Naturain 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 2014-07-1811:13:14这次div2很热闹。。足足有4000+人(虽然有很多高rating的不算排名=。=)A,B不多说了,来说说C,D吧。C:由于通神早早用RMQ高效的A了C题,我也转战RMQ解法,在最后2分钟绝杀AC了,但是在重判中WA了。。。原因就在于没有在递归过程中用贪心策略:如... 阅读全文
posted @ 2014-07-18 11:19 Naturain 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 2014-07-1721:29:52题意:经典的小木棍问题。问有这么n根小木棍,每根有自己的长度len(i)( 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 int n,sum,tmax,s[1... 阅读全文
posted @ 2014-07-17 21:46 Naturain 阅读(422) 评论(0) 推荐(0) 编辑
摘要: 2014-07-1715:31:29题意&思路:大概意思就是给出无向图,求从起点到终点的所有路径和路径总数。这题由于结点数最多21个,总情况数可能达到1!+(1!+2!)+(1!+2!+3!)+....+(1!+2!+....+21!)非常大,所以需要剪枝,方案1:从终点开始向前搜,把能直接或间接到... 阅读全文
posted @ 2014-07-17 15:38 Naturain 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 2014-07-1714:01:32题意&思路:无向有环图的染色问题,直接DFS回溯。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 int m,n,k,tmax,g[100][100],c[1... 阅读全文
posted @ 2014-07-17 14:03 Naturain 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 2014-07-1712:46:32题意&思路:给出图,建立邻接矩阵(数据量比较小,偷懒用下TAT),然后全排列,算出每种排列的最大bandwidth,最后取这些bandwidth的最小值即可。这种类型的题目基本遵循:sort,do..while()格式。 1 #include 2 #includ... 阅读全文
posted @ 2014-07-17 12:49 Naturain 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 2014-07-1623:55:21LeftCellRightNew[i-1][i][i+ 1]State00000 * 20 00111 * 2101000 * 2201111 * 2310011 * 2410100 * 2511011 * 2611100 * 2790=Automaton Id... 阅读全文
posted @ 2014-07-17 00:13 Naturain 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 2014-07-1616:12:32题意&思路:搜索递推逐个推下一个数,范围(前个数+1,前面数所能构成的n+1)。具体思路:http://blog.csdn.net/shuangde800/article/details/7755452这篇博文提供了暴力和动规两种思路~! 1 #include ... 阅读全文
posted @ 2014-07-16 16:15 Naturain 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 2014-07-1612:56:22题意&思路:变种的八皇后,只不过要记录路径和。自己敲了个DFS,当然佳哥写的也是一种思路:通过标记每列皇后的行数。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 ... 阅读全文
posted @ 2014-07-16 12:58 Naturain 阅读(242) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 32 下一页