摘要: Problem refer: https://leetcode.com/problems/student-attendance-record-ii/description 阅读全文
posted @ 2017-11-26 01:03 KRisen 阅读(296) 评论(0) 推荐(0) 编辑
摘要: Problem refer: https://leetcode.com/problems/shopping-offers/description/ Official solution refer: https://leetcode.com/problems/shopping-offers/solut 阅读全文
posted @ 2017-11-23 12:40 KRisen 阅读(213) 评论(0) 推荐(0) 编辑
摘要: Problem reference: https://leetcode.com/problems/longest-substring-without-repeating-characters 阅读全文
posted @ 2017-11-22 00:13 KRisen 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Problem reference: https://leetcode.com/problems/range-sum-query-2d-immutable 阅读全文
posted @ 2017-11-20 00:29 KRisen 阅读(222) 评论(0) 推荐(0) 编辑
摘要: // Problem Reference: https://leetcode.com/problems/diagonal-traverse /* My sulotion:Sets up x-y coordinates with the matrix.So, it only needs to find 阅读全文
posted @ 2017-11-19 15:18 KRisen 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 【题目大意】给定一个无向图,点i处有Ai头牛,点i处的牛棚能容纳Bi头牛,求一个最短时间T使得在T时间内所有的牛都能进到某一牛棚里去。(1 #include #include #include #include #include #define LL long long#define INF 1LL... 阅读全文
posted @ 2014-10-09 15:45 KRisen 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://www.acm.cs.ecnu.edu.cn/problem.php?problemid=1350http://main.edu.pl/en/archive/oi/8/kop求平面n个点(n#include #include #include #define lson rt=r... 阅读全文
posted @ 2014-10-08 23:46 KRisen 阅读(335) 评论(0) 推荐(0) 编辑
摘要: 题目要求给m个任务分配给n个机器,但最后任务量最多的那个机器的任务量尽量少,利用最大流,在最后的汇点那里设置关卡,二分结果,把机器到最终汇点的容量设置为该值,这样就达到题目条件,这样跑最大流 还能把m个任务跑完(最终流量为m),则可行,继续二分用的dinic#include #include #in... 阅读全文
posted @ 2014-10-06 11:37 KRisen 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 比赛的时候想的是把n个n个的题目进行状压 但这样不能讲究顺序,当时精神面貌也不好,真是挫死了其实此题的另一个角度就是一个n个数的排列,如果我对n个人进行状压,外面套一个按题目循序渐进的大循环,那么,在当前做第i个题目,前i-1个题目已经做完,然后做完的人的状态为j, j可能是1110 1101 10... 阅读全文
posted @ 2014-09-29 23:18 KRisen 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 今天西安网赛的题,因为被那个博弈卡住,没什么心情看这个这个题好像很简单的样子,但是看了下数据量,发现用n^2承受不起,然后我想了一下 没想出什么更低复杂度的算法出来。。后来发现别人还是用n方算法过的,只是用了下剪枝。。。。擦,我不是很敢尝试这种,,估计今天这个简单DP过的人不是很多 就是卡在时间上的... 阅读全文
posted @ 2014-09-14 21:22 KRisen 阅读(729) 评论(2) 推荐(0) 编辑