上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 46 下一页
摘要: A - Hello World! 求最小的粘贴次数,有个坑,小于0结束,以为是等于-1结束,错了几次。 B - Building designing 排个序就行了 C - Common Subsequence 最长子串,可以不连续的。 D - The Triangle 简单的DP,不过一开始用递归超 阅读全文
posted @ 2017-07-14 17:22 starry_sky 阅读(207) 评论(0) 推荐(0) 编辑
摘要: POJ - 2528 离散化是将有用的信息提取出来,在区间很大的时候,用直接用线段树肯定会超时,但由于在区间内很大值是没有用到的,只把有用的区间提取出来再用线段数做就方便多了。 阅读全文
posted @ 2017-07-14 10:55 starry_sky 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 成段更新就是在一个区域内进行操作,主要是要用lazy标记。 HDU - 1698 POJ - 3468 阅读全文
posted @ 2017-07-14 10:51 starry_sky 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 单点更新,其实就是对一个点进行更新。 HDU 1166 1 #include <iostream> 2 #include <stdio.h> 3 #include <string.h> 4 #define lson l,m,rt<<1 5 #define rson m+1,r,rt<<1|1 6 u 阅读全文
posted @ 2017-07-14 10:49 starry_sky 阅读(212) 评论(0) 推荐(0) 编辑
摘要: Guessing Camels Jaap, Jan, and Thijs are on a trip to the desert after having attended the ACM ICPC World Finals 2015 in Morocco. The trip included a 阅读全文
posted @ 2017-07-13 09:01 starry_sky 阅读(266) 评论(0) 推荐(0) 编辑
摘要: Ultra-QuickSort Ultra-QuickSort In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct 阅读全文
posted @ 2017-07-13 08:55 starry_sky 阅读(471) 评论(0) 推荐(0) 编辑
摘要: BST Consider an infinite full binary search tree (see the figure below), the numbers in the nodes are 1, 2, 3, .... In a subtree whose root node is X, 阅读全文
posted @ 2017-07-13 08:47 starry_sky 阅读(194) 评论(0) 推荐(0) 编辑
摘要: A. Restaurant Tables 题意是一个点单人座有a个双人座有b个,有n组人,每组人有一个或两个人。当一个人时优先坐单人座的没有就坐没有人坐的双人座,然后才是在已经坐了一人的双人座,还没有就拒绝为他服务。当两个人时,只坐双人座的没有就拒绝服务。问这个店要拒绝服务多少人。 直接模拟下就行了 阅读全文
posted @ 2017-07-12 13:38 starry_sky 阅读(159) 评论(0) 推荐(0) 编辑
摘要: A Number Sequence 求b序列在a序列出现的次数,KMP模板题: 1 #include <iostream> 2 #include <string.h> 3 #include <stdio.h> 4 char str[10010],str1[1000010]; 5 int nex[10 阅读全文
posted @ 2017-07-10 21:12 starry_sky 阅读(268) 评论(0) 推荐(0) 编辑
摘要: Gym - 100952A 水题,看谁的时间少谁就赢了,不然就是平局。 B HDU - 5752 错了好几次,算出来五个if就是错,用下for就对了。 CUESTC - 1599 n张图片,和成一个图片,每次合成消耗的值为两个图片社保值之和,优先队列一直取出来两个在放进去一个,直到只有一个图片就OK 阅读全文
posted @ 2017-07-10 20:14 starry_sky 阅读(239) 评论(0) 推荐(0) 编辑
上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 46 下一页