码迷,mamicode.com
首页 >  
搜索关键字:lintcode1 a+b problem solution 题解    ( 75925个结果
HDU 4513 吉哥系列故事——完美队形II(Manacher)
Problem Description 吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1、挑出的人保持原队形的相对顺...
分类:其他好文   时间:2014-05-10 19:42:07    阅读次数:309
An Unfair Game-[ACdream1035]
Problem DescriptionThere are n people and n target, everyone should get one target, no two people get the same target, the last one who get the target...
分类:其他好文   时间:2014-05-06 09:00:51    阅读次数:354
UPC 2224 Boring Counting (离线线段树,统计区间[l,r]之间大小在[A,B]中的数的个数)
题目链接:http://acm.upc.edu.cn/problem.php?id=2224题意:给出n个数pi,和m个查询,每个查询给出l,r,a,b,让你求在区间l~r之间的pi的个数(A#include #include #include #include #define lson rt>1;...
分类:其他好文   时间:2014-05-06 08:53:03    阅读次数:248
HDU 3308 LCIS(线段树)
Problem DescriptionGiven n integers.You have two operations:U A B: replace the Ath number by B. (index counting from 0)Q A B: output the length of the...
分类:其他好文   时间:2014-05-06 01:20:33    阅读次数:332
poj 1113 Wall
题目链接:http://poj.org/problem?id=1113题目大意:给出点集和一个长度L,要求用最短长度的围墙把所有点集围住,并且围墙每一处距离所有点的距离最少为L,求围墙的长度。解法:凸包+以L为半径的圆的周长。以题目中的图为例,两点之间的围墙长度之和正好就是凸包的长度,再加上每个点的...
分类:其他好文   时间:2014-05-06 00:56:54    阅读次数:325
2014 UESTC暑前集训数据结构专题解题报告
A.Islands这种联通块的问题一看就知道是并查集的思想。做法:从高水位到低水位依序进行操作,这样每次都有新的块浮出水面,可以在前面的基础上进行合并集合的操作。给每个位置分配一个数字,方便合并集合。同时将这些数字也排一个序,降低枚举的复杂度。合并集合时向四周查询浮出水面但是没有合并到同一集合的点进...
分类:其他好文   时间:2014-05-06 00:49:38    阅读次数:568
Virtual Barber of the Army of Mages
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=45301#problem/A题意:有n个人,k个理发师一。每个人需要理两次头发。每人有到达时间和他们等待的最大时间。求每个人能不能在他们等待的最长时间之前理完发。如果能,输出他理发的时刻。题...
分类:其他好文   时间:2014-05-06 00:22:52    阅读次数:334
LeetCode---Triangle
题目链接很简单的递推,但是写代码的过程中,犯了一个严重的错误,就是我用unsigned int型变量>= 0 作为循环条件(而且是降序)的时候,出现了问题。附上代码: 1 class Solution { 2 public: 3 int minimumTotal(vector > &tria...
分类:其他好文   时间:2014-05-06 00:10:57    阅读次数:335
HDU 4718 The LCIS on the Tree(树链剖分)
Problem DescriptionFor a sequence S1, S2, ... , SN, and a pair of integers (i, j), if 1 2 #include 3 #include 4 #include 5 using namespace std...
分类:其他好文   时间:2014-05-05 23:50:08    阅读次数:445
多面体与优化
多面体和优化有很大的关系,很多实际问题都可以形式化成和多面体或多面体函数相关的问题。此外,若一个问题的约束是多面体,则往往可以设计出比一般凸约束问题解法更好的优化算法,之前我们已经碰到过一些:凹函数$f$若在凸集$C$上不是常数函数,那么只可能在$C$的相对边界上取得最小值(命题1.3.4)。线.....
分类:其他好文   时间:2014-05-05 23:20:08    阅读次数:962
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!