上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 66 下一页
摘要: 题意:每次给出每两个数之间的大小差值。在给出关系的过程中插入询问:数a和数b的差值,若不能确定,输出UNKNOWN 解法:相对大小关系的处理:并查集 1.给出两点的相对大小关系后,找到两个点的根节点,并利用路径压缩,将两个点父亲指向根节点。然后将根节点进行合并,并给出根节点之间的相对大小关系 2.询... 阅读全文
posted @ 2015-12-09 20:45 meekyan 阅读(212) 评论(0) 推荐(0) 编辑
摘要: Find Metal MineralProblem DescriptionHumans have discovered a kind of new metal mineral on Mars which are distributed in point‐like with paths connect... 阅读全文
posted @ 2015-12-08 19:25 meekyan 阅读(152) 评论(0) 推荐(0) 编辑
摘要: ZYB's TreeMemory Limit: 131072/131072 K (Java/Others)问题描述ZYBZYB有一颗NN个节点的树,现在他希望你对于每一个点,求出离每个点距离不超过KK的点的个数.两个点(x,y)(x,y)在树上的距离定义为两个点树上最短路径经过的边数,为了节约读入和... 阅读全文
posted @ 2015-12-06 16:47 meekyan 阅读(262) 评论(0) 推荐(0) 编辑
摘要: 1878: [SDOI2009]HH的项链DescriptionHH有一串由各种漂亮的贝壳组成的项链。HH相信不同的贝壳会带来好运,所以每次散步 完后,他都会随意取出一段贝壳,思考它们所表达的含义。HH不断地收集新的贝壳,因此, 他的项链变得越来越长。有一天,他突然提出了一个问题:某一段贝壳中,包含... 阅读全文
posted @ 2015-12-05 15:01 meekyan 阅读(227) 评论(0) 推荐(0) 编辑
摘要: D. New Year Santa NetworkNew Year is coming in Tree World! In this world, as the name implies, there arencities connected byn - 1roads, and for any tw... 阅读全文
posted @ 2015-12-03 14:30 meekyan 阅读(371) 评论(0) 推荐(0) 编辑
摘要: 2424: [HAOI2010]订货Description某公司估计市场在第i个月对某产品的需求量为Ui,已知在第i月该产品的订货单价为di,上个月月底未销完的单位产品要付存贮费用m,假定第一月月初的库存量为零,第n月月底的库存量也为零,问如何安排这n个月订购计划,才能使成本最低?每月月初订购,订购... 阅读全文
posted @ 2015-11-25 18:58 meekyan 阅读(261) 评论(0) 推荐(1) 编辑
摘要: 1403 有趣的堆栈大家都熟悉堆栈操作。一个堆栈一般有两种操作,push和pop。假设所有操作都是合法的并且最终堆栈为空。我们可以有很多方法记录堆栈的操作,(1) 对每个pop操作,我们记录它之前一共有多少个push操作。(2) 对每个pop操作,我们记录这个被Pop的元素曾经被压上了几个。例如:操... 阅读全文
posted @ 2015-11-24 20:47 meekyan 阅读(260) 评论(0) 推荐(0) 编辑
摘要: matrixProblem DescriptionGiven a matrix withnrows andmcolumns (n+mis an odd number ), at first , you begin with the number at top-left corner (1,1) an... 阅读全文
posted @ 2015-11-21 22:27 meekyan 阅读(227) 评论(0) 推荐(0) 编辑
摘要: sequence2Problem DescriptionGiven an integer arraybiwith a length ofn, please tell me how many exactly different increasing subsequences.P.S. A subseq... 阅读全文
posted @ 2015-11-21 22:24 meekyan 阅读(337) 评论(0) 推荐(0) 编辑
摘要: sequence1Given an arrayawith lengthn, could you tell me how many pairs(i,j)( i #include #include #include #include #include #include #include #include... 阅读全文
posted @ 2015-11-21 22:21 meekyan 阅读(169) 评论(0) 推荐(0) 编辑
上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 66 下一页