E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
Largest
hdu1506 & pku2559
Largest
Rectangle in a Histogram
hdu1506&pku2559 #include intH[100005],l[100005],r[100005]; main() { __int64max,area; inti,n; while(scanf("%d",&n),n) { for(i=1;i1&&H[i]=1;i--) while(r[i]
dellaserss
·
2012-07-22 20:00
HDU 1506
Largest
Rectangle in a Histogram(单调栈)
题目链接:Clickhere~~题意:这就是前几篇已经提到的求最大长方形那道题。解题思路:如果每次都向前向后扫描,有时会重复扫描多次,导致超时。我们可以用一个单调栈(类似单调队列)由低到高来存储它的高度,并用数组对每个高度记录一下它前面(包括它自己)一共有多少个比它高的,可以看做它的左宽。按顺序考虑每个高度h,如果h大于栈顶元素,则入栈,此时它大于左面全部的元素(下文会提到为什么可以这样认为),并
dgq8211
·
2012-07-13 09:00
创建最大堆
#include #defineLEFT(i)(iarr[root])
largest
=leftchild; else
largest
=root; if(rightchildarr[root]) l
jiagou
·
2012-07-12 16:00
创建
HDU OJ 1506
Largest
Rectangle in a Histogram 和 NYOJ 258 最大长方形(二) 【单调队列】
原题连接: http://acm.hdu.edu.cn/showproblem.php?pid=1506 (hdu)思路:单调队列,开两个数组stack[]和len [] stack[]存输入的长len[ ]存宽。stack里面按单增存,遇到比stack[top]小的数据就要讲顶部元素删除,直到删后顶部可以存为止,在删之前要看是否可以更新ans((l+len[top])*stack[top]与当前
PIAOYI0208
·
2012-07-12 14:00
HDU 2870
Largest
Submatrix(最大完全子矩阵之不可移动列)
题目链接:Clickhere~~题意:和HDU2830类似,只是这次不能再将列任意移动,于是题目完全变成了求最大长方形那道题。解题思路:只说如何求最大长方形,我的思路是枚举每个高度,然后以它做基准,向左向右扩张,扩张条件是h[i-k]>=h[k]、h[i+k]>=h[k]。记录扩张的个数即可。没想到这题竟然进rank了,好高兴。话说我都没用传说中的单调队列呢。#include #include #
dgq8211
·
2012-07-12 08:00
C++
c
Asians Now
Largest
Group of New US Immigrants
A new study says Asians are now the
largest
group of new immigrants arriving in the United States each
oywl2008
·
2012-06-25 00:00
grant
hdu 1506
Largest
Rectangle in a Histogram DP 单调队列
//考察点:动态规划,又有说是单调队列(还不了解) //思路:为每一个点记录可以左最远延伸到的位置,和向右最远延伸到的位置 //但是不能暴搜,会超时的。具体见下面的代码 //提交情况:1.TLE多次,原因:h[0]=h[n+1]设置成了0,会出现问题 //提交情况:2.WA多次,原因:必须要将数组改成__int64类型的才能通过 //收获:使用l[i]=l[l[i]-1]这样的语句可以使滑动速度加
chen895281773
·
2012-06-05 20:00
AIX中The
largest
dump device is too small的处理
http://blog.chinaunix.net/uid-23144817-id-2536760.html 检查系统,在errpt中出现如下报错信息:E87EF1BE 0322150010POdumpcheck Thelargestdumpdeviceistoosmall.errpt-ajE87EF1BE-----------------------------------------
wll_1017
·
2012-05-21 17:00
hdu 1506(
Largest
Rectangle in a Histogram)
hdu1506(LargestRectangleinaHistogram) 1 #include 2 #include 3 #include 4 #define MAXSIZE 100005 5 int dp[MAXSIZE]; 6 int l[MAXSIZE],r[MAXSIZE]; 7 8 inline void scan(int &x){ 9 char ch;10 w
冰王子Leo与ACM一起的成长
·
2012-05-15 00:00
堆排序
#include usingnamespacestd; voidMaxheapify(intA[],inti,intsize){ intleft=2*i,right=2*i+1,
largest
; if(
ise_gaoyue1990
·
2012-05-07 21:00
include
find kth
largest
number in an array
在一个数组中,找出第K打的数,原本以为很简单,但是就是这么个小东西,我写了半天,唉.....好丢人阿.大家多多指教哈.....思想是:给定的数组中,先对前K个元素进行排序,我用的是最最简单的bubblesort,然后从第K+1个元素开始,逐个和第K个元素进行比较,如果比K个元素小就不用考虑了,如果比第K个元素大,就要想办法插入进前K个元素序列中,在插入的过程中,还需要从原有的K序列中,弹出元素。这
mci2004
·
2012-05-07 16:00
REST
null
input
insert
merge
Numbers
欧拉计划第4题
The
largest
palindrome made from the product of two 2-digit numbers is 9009=91*99.
ll_0520
·
2012-04-30 19:00
null
欧拉计划第3题
What is the
largest
prime factor of the number 600851475143.问题3: 13195的质因数为5,7,13和29。
ll_0520
·
2012-04-30 18:00
[置顶] hdu 2870
Largest
Submatrix
hdu1505/hdu1506最大子矩阵#include #include #include usingnamespacestd; /*ashione2012-4-24 最大子矩阵变形,枚举a,b,c即可。 l,r的最大距离操作参照hdu1505. */ #defineMAXN1005 charstr[MAXN][MAXN]; charfun[]={'a','b','c','w','x','y',
a342374071
·
2012-04-24 22:00
c
fun
ZOJ1985 POJ2259 HDU1506
Largest
Rectangle in a Histogram
如果穷举的话,肯定会超时的。对于left_array[x],它记录以array[x]为最低长度的左边界坐标;right_array[x]它记录了以array[x]为最低长度的右边界坐标。一开始都分别等于x;#ifdef_MSC_VER #defineDEBUG #define_CRT_SECURE_NO_DEPRECATE #endif #include #include #defineMAX1
neofung
·
2012-04-14 20:00
hdu oj 2136
Largest
prime factor 和 nyoj 520 最大素因子 【筛选法】
hudoj2136 链接:http://acm.hdu.edu.cn/showproblem.php?pid=2136nyoj 520 链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=520这两个题是一样的,nyoj就是翻译hduoj的,在hduoj看不懂题的可以到nyoj去看看。。这个题是貌似还是ice翻译过来的,说一下思路吧。看看题时间
PIAOYI0208
·
2012-04-10 07:00
NYOJ 520 & HDU 2136
Largest
prime factor(筛法思想)
题目链接:Click here~~ 题意是求出某个数n的最大素因子是第几个素数。 原以为是水题,没想到低估它了。 开始时我先把100W内的素数打表,然后用欧拉函数的做法,对每个数挨个分解质因子,得到最大的素因子,输出它的下标。 结果,悲剧的TLE了。 后来小冰告诉我,可以用筛法的思想做,我顿悟了。做法如下: 表中不在记录素数的值,而是直接记录素数的序数。 从2开始循环,当遇到为0的值
lovnet
·
2012-04-09 14:00
Prim
NYOJ 520 & HDU 2136
Largest
prime factor(筛法思想)
题目链接:Clickhere~~题意是求出某个数n的最大素因子是第几个素数。原以为是水题,没想到低估它了。开始时我先把100W内的素数打表,然后用欧拉函数的做法,对每个数挨个分解质因子,得到最大的素因子,输出它的下标。结果,悲剧的TLE了。后来小冰告诉我,可以用筛法的思想做,我顿悟了。做法如下:表中不在记录素数的值,而是直接记录素数的序数。从2开始循环,当遇到为0的值时,证明它是素数,这时候把它的
dgq8211
·
2012-04-09 14:00
How do I find the
largest
top 10 files in linux?
阅读更多http://www.cyberciti.biz/faq/how-do-i-find-the-
largest
-filesdirectories-on-a-linuxunixbsd-filesystem
standalone
·
2012-04-06 15:00
How do I find the
largest
top 10 files in linux?
http://www.cyberciti.biz/faq/how-do-i-find-the-
largest
-filesdirectories-on-a-linuxunixbsd-filesystem/
standalone
·
2012-04-06 15:00
linux
Problem 3 of
largest
prime factor
Theprimefactorsof13195are5,7,13and29.Whatisthelargestprimefactorofthenumber600851475143?http://projecteuler.net/problem=3publicclassPrimeNum{ publicstaticvoidmain(Stringargs[]){ doublel=600851475143.0
comkingfly
·
2012-03-15 13:00
String
Class
HDOJ 1506 :
Largest
Rectangle in a Histogram DP求解
题目URL:http://acm.hdu.edu.cn/showproblem.php?pid=1506这是一道动态规划求解题目,如果暴力枚举起点和终点的话,以这道题目的数据量,必然超时。动态规划求解的两个重要函数,left[i]:表示从left[i]到i的所有的立方柱的高度都大于或等于第i个立方柱的高度。很显然,当前i-1个的leff[i]求解出来之后,left[i]的求解便很简单了,不断
bruce128
·
2012-03-05 12:00
System
FAQS
1.How can I get the
largest
amount of physical reads by any query?
edwards0307
·
2012-02-09 15:00
AQS
id=3781&&Nth
Largest
Value
#include #include usingnamespacestd; intmain() { intCase; cin>>Case; setQ; for(inti=1;i>t; Q.clear(); for(intj=0;j>a; Q.insert(a); if(Q.size()>3)Q.erase(Q.begin()); } cout<
smallacmer
·
2012-02-01 17:00
poj 2559 hdu 1506
Largest
Rectangle in a Histogram
#include usingnamespacestd; constintmaxn=100000+10; inta[maxn],b[maxn],c[maxn];//a[i]:高度b[i]:左边小于a[i]高度的第一个c[i]:右边小于a[i]高度第一个 inlinevoidread(int&d) { charch; while(ch=getchar(),ch>'9'||ch='0';d=d*10+c
wxfwxf328
·
2012-01-25 14:00
c
《Pro Oracle SQL》Charpter2 --2.5 SGA – The Buffer Cache
nbsp; SGA-缓冲区缓存 (page59) The buffer cache is one of the
largest
caohong286
·
2012-01-15 16:00
oracle
sql
dba
Apress
Pro Oracle SQL
sql查看oracle tablespace剩余空间
select a.TABLESPACE_NAME, a.BYTES bytes_used, b.BYTES bytes_free, b.
largest
, round(((a.BYTES-b.BYTES
blessed24
·
2012-01-01 10:00
tablespace
堆排序
definePARENT(i)(i>>1) #defineLEFT(i)(iheap_size) { return; } if(left0) { if(a_heap[left]>a_heap[i]) {
largest
luomoweilan
·
2011-12-26 00:00
null
Build
include
hdu 2870
Largest
Submatrix
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2870hdu1505的加强版。。枚举+DP。分明知道思路了。。但是发现打出来还是有点困难。。还是不够熟练。下面是转载某大牛的代码:#include usingnamespacestd; constintmaxn=1005; inth[maxn][maxn]; intl[maxn],r[maxn]; cha
w00w12l
·
2011-12-08 21:00
c
UVa Problem 10215 The
Largest
/Smallest Box... (最大/最小的盒子)
//TheLargest/SmallestBox...(最大/最小的盒子) //PC/UVaIDs:111306/10215,Popularity:A,Successrate:averageLevel:2 //Verdict:Accepted //SubmissionDate:2011-11-02 //UVaRunTime:0.040s // //版权所有(C)2011,邱秋。metaphysis
metaphysis
·
2011-11-13 07:00
ios
c
Date
uva2819
option=com_onlinejudge&page=show_problem&problem=2819 title:
Largest
Empty Circle
goAheadtw
·
2011-11-13 02:00
计算几何
hdu 1506
Largest
Rectangle in a Histogram(DP)
LargestRectangleinaHistogramTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):3722 AcceptedSubmission(s):1104ProblemDescriptionAhistogramisapolygoncompo
gzhu_101majia
·
2011-11-13 00:00
HDU
ProjectRuler-4
The
largest
palindrome made from the product of two 2-digit numbers is 9009 = 91 99.
shaorui23
·
2011-11-04 12:00
project
ProjectRuler-3
#What is the
largest
prime factor of the number 600851475143 ?
shaorui23
·
2011-11-04 12:00
project
poj 2559
Largest
Rectangle in a Histogram dp!!!
话说这种相当于压缩路径的方法,我还是没怎么掌握!!!#include usingnamespacestd; typedeflonglongll; lla[100005]; intmain() { intleft[100005],right[100005]; intn; while(scanf("%lld",&n),n!=0) { for(inti=1;i=a[i]) le
youngyangyang04
·
2011-10-05 19:00
欧拉项目 problem3(求最大质因素)
What is the
largest
prime factor of the number 600851475143 ?
xiaoxie
·
2011-09-13 18:00
项目
android error: Apostrophe not preceded 错误解决办法
android项目,资源文件values中报特殊字符没有被转义错误,错误信息如下: error: Apostrophe not preceded by \ (in Shanghai is China’s
largest
jakend
·
2011-09-09 11:00
android
android error: Apostrophe not preceded 错误解决办法
android项目,资源文件values中报特殊字符没有被转义错误,错误信息如下: error: Apostrophe not preceded by \ (in Shanghai is China’s
largest
jakend
·
2011-09-09 11:00
android
Problem 41
What is the
largest
n-dig
to_zoe_yang
·
2011-08-19 15:00
em
Python 的else
showMaxFactor(num): count=num/2 while count>1: if num % count ==0: print '
largest
hc990
·
2011-07-18 18:00
python
a2qq
-- m --> FreshMeatWeb's
largest
index of Unix and cross-platform software, themes and related "
samson7b
·
2011-07-09 18:00
qq
堆排序(Heap Sort)
defineMAX10 voidmaxHeapify(int*arr,inti,intsize) { intl=(i+1)*2-1; intr=(i+1)*2; intlargest,t; if(l+1arr[i])
largest
CherylNatsu
·
2011-07-02 13:00
null
include
POJ2559
Largest
Rectangle in a Histogram [单调栈]
题意:给定多个矩形,求最大的合并面积。思路:和POJ2082【前一篇文章】一样的题目。还是单调栈的应用,关键还是理解单调时候可以用O(N)的算法处理,所以处理成单调栈。本质思路参看前一篇文章。不过注意要用__int64或者longlong。#include #include #include #include #definemax(a,b)(a>b?a:b) #defineabs(a)((a)>0
wuyanyi
·
2011-06-24 11:00
算法
Problem 3
What is the
largest
prime factor of the number 600851475143 ? 找出一个数字的最大因子。
to_zoe_yang
·
2011-06-12 20:00
em
Problem 4
The
largest
palindrome made from the product of two 2-digit numbers is 9009 = 91 99.
to_zoe_yang
·
2011-06-12 19:00
em
HDU 2136
Largest
prime factor
http://acm.hdu.edu.cn/showproblem.php?pid=2136 题意:求出n的最大素数因子的位置 Sample Input 1 2 3 4 5 Sample Output 0 1 2 1 3 #include <iostream> using namespace std; #define maxs
基德KID.1412
·
2011-06-04 23:00
C++
c
算法
编程语言
ACM
Problem three.
What is the
largest
prime factor of the number 600851475143 ? You may have a try first!
jonson
·
2011-05-24 13:00
em
ProjectEuler第三题
Find the
largest
prime factor of a composite number. 求600851475143的最大质因数。
linuke
·
2011-05-24 10:00
java
hdu 2136
Largest
prime factor (分解素数技巧)
题目的大意是将一个数分解成素数的乘积。求最大的那个素数在素数表中的位置。与 FZU.1012(http://acm.fzu.edu.cn/problem.php?pid=1012)这一题分解素数的方法与原理相似。用prime[i]来存放i这个数字分解后最大素数的位置。2是素数,所以prime[2]=1;再先将所有2的倍数的prime[]都更新为1.即prime(4,6,8,10)都为1.又因为6
·
2011-05-08 12:00
Prim
排序那点事(三)
排序那点事(三)终于到了堆排序了,不过在写堆排序之前得先看看选择排序,毕竟堆排序的根本思想还是源于选择排序选择排序: i a[head]) 8 { 9
largest
myjfm
·
2011-05-01 00:00
上一页
33
34
35
36
37
38
39
40
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他