码迷,mamicode.com
首页 >  
搜索关键字:zoj 线段树    ( 12657个结果
zoj Gao The Sequence
Gao The SequenceTime Limit:2 Seconds Memory Limit:65536 KBYou are given a sequence of integers,A1,A2,...,An. And you are allowed a manipulation on the...
分类:其他好文   时间:2014-05-13 19:49:14    阅读次数:277
临时代码。
zoj 3673 1 /** 2 6700417 3 **/ 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 typedef unsigned long long LL;12 13 ...
分类:其他好文   时间:2014-05-13 18:07:32    阅读次数:234
ZOJ3675:Trim the Nails
Robert is clipping his fingernails. But the nail clipper is old and the edge of the nail clipper is potholed. The nail clipper's edge is N millimeters wide. And we use N characters('.' or '*') to rep...
分类:其他好文   时间:2014-05-13 15:05:54    阅读次数:264
ZOJ3671:Japanese Mahjong III
Mahjong is a game of skill, strategy and calculation and involves a certain degree of chance. In this problem, we concentrate on Japanese Mahjong, a variation of mahjong. For brief, all of the word ma...
分类:其他好文   时间:2014-05-13 14:59:51    阅读次数:356
POJ3067:Japan(线段树)
Description Japan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast and M cities on the West coast (M <= ...
分类:其他好文   时间:2014-05-13 14:53:40    阅读次数:189
ZOJ3673:1729
1729 is the natural number following 1728 and preceding 1730. It is also known as the Hardy-Ramanujan number after a famous anecdote of the British mathematician G. H. Hardy regarding a hospital vis...
分类:其他好文   时间:2014-05-13 14:52:34    阅读次数:314
线段树-poj-2823
大意:给出数组a,内容为 a1 a2 a3 ... an。再给一个常数k。从i=1起,计算ai、a i+1、...、a i+k-1区间内的最小值和最大值。 线段树咯。...
分类:其他好文   时间:2014-05-13 14:11:41    阅读次数:187
poj2104(主席树)
K-th Number Time Limit: 20000MS   Memory Limit: 65536K Total Submissions: 35704   Accepted: 11396 Case Time Limit: 2000MS Description You are working for Macrohard com...
分类:其他好文   时间:2014-05-13 14:07:41    阅读次数:203
ZOJ 3684 Destroy 树的中心
中心节点就是树的中心,2遍dfs求到树的直径,而中心一定在直径上,顺着直径找到中心就够了。 然后可以一遍树形DP找到最小值或者二分+判断是否访问到叶子节点。 #include #include #include #include using namespace std; struct node { int next; int power; int length...
分类:其他好文   时间:2014-05-13 11:28:38    阅读次数:306
zoj 3627(贪心)
思路:半夜了思路有点混乱wa了好几发。一开始坑定两个人距离为m才能获得最大的收益,所以我们就可以枚举单个端点,当距离达到m时在一同一个方向走这是我们只需要算一下剩下几秒,左右两边贪心去最大的即可。代码如下: 1 /*******************************************...
分类:其他好文   时间:2014-05-13 09:58:02    阅读次数:268
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!