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
(1054)
【C++】PAT(advanced level)
1054
. The Dominant Color (20)
1054
.TheDominantColor(20)时间限制100ms内存限制32000kB代码长度限制16000B判题程序StandardBehindthescenesinthecomputer'smemory
artemisrj
·
2014-03-03 14:00
PAT (Advanced)
1054
. The Dominant Color (20)
方法一:使用map#define_CRT_SECURE_NO_WARNINGS #include #include #include usingnamespacestd; mapmp; map::iteratorit; intmain() { intm,n; cin>>m>>n; for(inti=0;isecond>m*n/2) { coutfirst usingnamespacestd
hale1007
·
2014-03-02 14:00
PAT
1054
. The Dominant Color
题目:http://pat.zju.edu.cn/contests/pat-a-practise/
1054
题解:因为题目说明了要找的数大于总数的一半,因此可以拿两个不同的数进行相抵消,这样剩下的数就是要求的数
ACM_Ted
·
2014-02-28 16:00
Pat(Advanced Level)Practice--
1054
(The Dominant Color)
Pat
1054
代码题目描述:Behindthescenesinthecomputer'smemory,colorisalwaystalkedaboutasaseriesof24bitsofinformationforeachpixel.Inanimage
u012736084
·
2014-02-28 14:00
C++
pat
基础题
advance
题目
1054
:字符串内排序
#include #include intpartition(chara[],charp,intr) { charx=a[r]; intmiddle=p; for(intj=p;j
liuguiyangnwpu
·
2014-02-22 15:00
复试机试题
OJ机试
poj2594匈牙利算法+邻接表+传递闭包
题意:给你一个有向图,求最大路覆盖数,但是点可以重复;解题思路:这题跟hdu
1054
的不同之处是可以走重复的点,那么我们就可以这样想,假如这个点会被走重,那么我们就加一条边去跨过这个点,那么当这个点的相邻点集中
qeroLai
·
2014-02-13 17:23
include
匈牙利
hdu
1054
求最小点覆盖集,最小点覆盖集=最大匹配集,继续匈牙利算法解决这里注意,输入的是根树一开始想先把根树转回二部图,发现比较麻烦最后直接把根树看成无向图来解决,即把边看成无向边,建立邻接表时一直两个顶点都插入,最后求得的匹配数除二就ok了不过时间用了太多了,有空再想优化吧543+ms代码#include
qeroLai
·
2014-02-13 17:22
include
result
匈牙利
HDU
1054
Strategic Game
ProblemDescriptionBobenjoysplayingcomputergames,especiallystrategicgames,butsometimeshecannotfindthesolutionfastenoughandthenheisverysad.Nowhehasthefollowingproblem.Hemustdefendamedievalcity,theroadso
lphy2352286B
·
2014-02-09 09:00
hdu
1054
匈牙利算法(增广路) (附匈牙利算法模板)
嗯。。。。今天开始写博客。。。。大一过去一半了。。。希望下半年能有个好的开始吧先贴上百度百科里面对匈牙利算法的描述算法轮廓:⑴置M(这里M是图的一个子边集,也就是现在要求的最大匹配的边集)为空⑵找出一条增广路径P,通过异或操作获得更大的匹配M’代替M⑶重复⑵操作直到找不出增广路径为止而在代码的实现中,我们考虑枚举二分图左边点集中的点x的所有出边指向的点y,若y之前没有被匹配,那么(x,y)就是一对
u012513980
·
2014-02-06 15:00
算法
ACM
HDU
最大匹配
最小点覆盖
HDU -
1054
Strategic Game
题意:给定一棵树,选择最小的节点,使得每个没有被选中的节点至少和一个已选节点相邻思路:简单的树形DP#include #include #include #include #include usingnamespacestd; constintMAXN=1600; vectorg[MAXN]; intdp[MAXN][2],vis[MAXN]; intn,num,x; voiddfs(intr
u011345136
·
2013-12-21 11:00
【九度】排序整理
1007奥运排序问题1023EXCEL排序
1054
字符串内排序1061成绩排序1066字符串排序1099后缀子串排序1117整数奇偶排序1130日志排序1135字符串排序1167数组排序1185特殊排序
u013027996
·
2013-12-10 17:00
基于visual Studio2013解决C语言竞赛题之
1054
抽牌游戏
题目解决代码及点评/************************************************************************/ /* 54.有N张牌,计算机和你轮流取牌,每次只能取1─2张,谁最后取完谁胜利。编写完成此功能的程序。 要求: 1)让计算机先取。 2)你取的张数由键盘输入。 3)计算机第一次取牌时由键盘输入来确定是取1还是取2,以后它
yincheng01
·
2013-12-09 23:00
【九度】题目
1054
:字符串内排序
pid=
1054
题目描述:输入一个字符串,长度小于等于200,然后将输出按字符顺序升序排序后的字符串。输入:测试数据有多组,输入字符串。输出:对于每组输入,输出处理后的结果。
u013027996
·
2013-12-09 12:00
1054
(枚举)
1054
:TheTroublesomeFrog总时间限制:5000ms内存限制:100000kB描述InKorea,thenaughtinessofthecheonggaeguri,asmallfrog
再_见孙悟空
·
2013-11-22 14:00
1054
hdu
1054
Strategic Game 树上的点覆盖集
题目即求树上的点覆盖数。对于一个图的点覆盖集,都不存在多项式内的解法,但如果是树的话,却挺容易,有三种方法,第一个是贪心,第二个是树形dp,第三个是二分图匹配(树是一个二分图),我是用贪心做的,先深度优先遍历一遍得到遍历序列,将遍历序列反向(即后序遍历序列)进行贪心,这样可以保证对于每个节点来说,当其子树都被处理过后才轮到该节点,保证了贪心的正确性,贪心思路为:若当前点和当前点的父节点都不属于点覆
KIDGIN7439
·
2013-11-18 23:00
HDOJ
1054
—— 最小点覆盖
StrategicGameTimeLimit:20000/10000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):4073 AcceptedSubmission(s):1801ProblemDescriptionBobenjoysplayingcomputergames,especiall
zkzxmzk
·
2013-11-11 04:00
ACM
二分图
编译器错误C999 到 C4999查询详解(整理在此,方便以后查询)
编译器错误 错误 C1001错误 C1002错误 C1004错误 C1009错误 C1010错误 C1017错误 C1026错误 C1033错误 C1046错误 C1051错误 C
1054
错误 C1055
bjtbjt
·
2013-11-06 12:00
lightoj
1054
- Efficient Pseudo Code 求所有n^m的所有因子和
题意:求n^m的所有因子和。题解:我们需要先知道,一个数X=p1^t1*p2^t2*...*pk^tk(pi为素数),还需要知道X的所有因子和sum(X)=(p1^0+p1^1+...+p1^t1)*...*(pk^0+pk^1+...+pk^tk)。证明略,以前证明过,可以自己在我其他文中找下,好像那题跟这题一样,就是因子都是排列组合ti得到的。所以结果就很简单了,n^m=p1^(t1*m)*.
a601025382s
·
2013-10-22 14:00
PKU Online Judge
1054
PKUOnlineJudge / 练习题目排名状态提问
1054
:Cube查看提交统计提问总时间限制: 1000ms 内存限制: 131072kB描述Delayyy君很喜欢玩某个由Picks编写的方块游戏
u010422038
·
2013-10-15 15:00
DFS+思维-PKU Online Judge-
1054
:Cube
题目链接:http://poj.openjudge.cn/practice/
1054
/题目意思:在2D空间里,有N个村庄,有N-1条路(所有的路都是水平或竖直的),使得N个村庄两两间都连通。
cc_again
·
2013-10-14 17:00
DFS
PKU Online Judge
1054
:Cube (设置根节点)
1054
:Cube总时间限制: 1000ms 内存限制: 131072kB描述Delayyy君很喜欢玩某个由Picks编写的方块游戏,游戏在一个由单位格组成的棋盘上进行。
u010228612
·
2013-10-14 14:00
hdu
1054
Strategic Game 最小顶点覆盖(二分图最大匹配)
题意:找出最少的点,使得所有的边都被覆盖。题解:最大匹配:定义:给出一个二分图,找一个边数最大的匹配,即选尽量多的边,使得任意两条选中的边均没有公共点。如果所有点都是匹配点,则称这个匹配为完美匹配。定理:柯尼希定理:二分图最小点覆盖的点数=最大匹配数。最小路径覆盖的边数=顶点数n-最大匹配数最大独立集=最小路径覆盖=顶点数n-最大匹配数增广路定理:用未盖点表示不与任何匹配边邻接的点,其他点位匹配点
a601025382s
·
2013-09-06 20:00
最大匹配
最小顶点覆盖
【PAT】
1054
The Diamond Color
题目:http://pat.zju.edu.cn/contests/pat-a-practise/
1054
题目描述:Behindthescenesinthecomputer'smemory,colorisalwaystalkedaboutasaseriesof24bitsofinformationforeachpixel.Inanimage
realxuejin
·
2013-08-22 20:00
pat
cc++
HDU1068Girls and Boys(最大独立数)
根据HDU
1054
http://blog.csdn.net/u010270403/article/details/10048577的讲解,应该对最大匹配数和匈牙利算法(求解最大匹配数的算法)有所了解,所以在此就不多说了
u010270403
·
2013-08-18 18:00
最大独立数
HDU
1054
Strategic Game(最小顶点覆盖数)
我们来先了解一下什么是最小顶点覆盖;图G的顶点覆盖是一个顶点集合V,使得G中的每一条边都接触V中的至少一个顶点。我们称集合V覆盖了G的边。最小顶点覆盖是用最少的顶点来覆盖所有的边。顶点覆盖数是最小顶点覆盖的大小。相应地,图G的边覆盖是一个边集合E,使得G中的每一个顶点都接触E中的至少一条边。如果只说覆盖,则通常是指顶点覆盖,而不是边覆盖。在二分图中 :最大匹配数=最小顶点覆盖数;求二分图最大匹配可
u010270403
·
2013-08-18 17:00
最大匹配数
最小顶点覆盖
hdu
1054
Strategic Game (最小顶点覆盖 邻接矩阵)
pid=
1054
//最小顶点覆盖==最大匹配(双向图)/2 #include #include #include #defineMAXN1505 usingnamespacestd; vectormap
lezong2011
·
2013-08-11 22:00
HDU
1054
&& POJ1463:Strategic game(树形DP)
DescriptionBobenjoysplayingcomputergames,especiallystrategicgames,butsometimeshecannotfindthesolutionfastenoughandthenheisverysad.Nowhehasthefollowingproblem.Hemustdefendamedievalcity,theroadsofwhichf
libin56842
·
2013-08-07 23:00
poj
树形DP
九度笔记之 1352:和为S的两个数字
题目1352:和为S的两个数字时间限制:2秒内存限制:32兆特殊判题:否提交:
1054
解决:256题目描述:输入一个递增排序的数组和一个数字S,在数组中查找两个数,是的他们的和正好是S,如果有多对数字的和等于
KingEasternSun
·
2013-08-05 15:00
1054
. The Dominant Color (20)-PAT
1054
.TheDominantColor(20)时间限制100ms内存限制32000kB代码长度限制16000B判题程序StandardBehindthescenesinthecomputer'smemory
zoushidexing
·
2013-08-03 19:00
hdu
1054
(二分图+最小点覆盖数+匈牙利算法)
StrategicGameTimeLimit:20000/10000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):3735 AcceptedSubmission(s):1644ProblemDescriptionBobenjoysplayingcomputergames,especiall
xj2419174554
·
2013-07-26 17:00
图论
二分图
最小点覆盖数
动态代理方案性能对比
转:http://code.alibabatech.com/blog/experience_
1054
/dynamic_proxy_performance.html 因服务框架需要用动态代理生成客户端接口的
wsmajunfeng
·
2013-07-24 22:00
动态代理
动态代理方案性能对比
转:http://code.alibabatech.com/blog/experience_
1054
/dynamic_proxy_performance.html 因服务框架需要用动态代理生成客户端接口的
wsmajunfeng
·
2013-07-24 22:00
动态代理
POJ搜索专题(转转)
1010stamps1011sticksAccepted2006-08-0304:091020AnniversaryCake1022PackingUnit4DCubes1024TesterProgram
1054
TheTroublesomeFrog1062
paradiserparadiser
·
2013-07-24 15:00
Hdu
1054
Strategic Game
StrategicGameTimeLimit:20000/10000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):3714 AcceptedSubmission(s):1630ProblemDescriptionBobenjoysplayingcomputergames,especiall
Magic____
·
2013-07-22 10:00
SVN Skipped 'xxx' -- Node remains in conflict
:Skipped'xxx'--NoderemainsinconflictAtrevision
1054
.Summaryofconflicts: Skippedpaths:1处理方式:#cd/home/svn
xiangliangyu2008
·
2013-07-02 20:00
poj-
1054
-The Troublesome Frog-搜索+剪枝
直接暴力搜索:24796K2219MS优化剪枝:24796K1032MS#include #include #include #include usingnamespacestd; #defineN5001 structlist { intx; inty; boolfriendoperatorr||yc)return0; return1; } intmain() { cin>>r>>c; cin>
rowanhaoa
·
2013-06-27 20:00
MySQL
1054
错误 Unknown column .... in 'on clause'
提示: ERROR
1054
(42S22): Unknown column ... in 'on clause' 原因: MySQL5.0 Bug, 要把联合的表用括号包含起来才行:
flex_莫冲
·
2013-06-17 14:00
column
pat
1054
The Dominant Color
求数组中出现次数超过一半的数字,排序再取中位数太慢,hash表记录出现次数,空间复杂度太高,从另一个角度来看,出现次数超过一半的数字,其出现次数比其它所有数出现之和还多,每次从数组中除去两个不同的数字,直到最后,剩下的肯定是所求。用cad(候选)表示所求的数,nTime为它出现的次数。依次遍历数组,若a[i]和cad不同则nTime--;若相同则nTime++; 若nTime为0,则取下一个数作为
jjike
·
2013-05-24 16:00
hdu
1054
二分匹配,求最大点独立集合,边是双向边,每个点用了两次,最后除以二。代码:#include #include #include #include #definemaxn1505 usingnamespacestd; vectorg[maxn]; intvis[maxn]; intlink[maxn]; boolgetnum(intu) { for(inti=0;i
qq415200973
·
2013-05-06 14:00
二分图匹配
hdu1054
PAT
1054
. The Dominant Color (20)
题目地址:http://pat.zju.edu.cn/contests/pat-a-practise/
1054
此题没有怎么难的,用下map就行了。
eli850934234
·
2013-05-04 15:00
编程
ACM
pat
浙大
LightOj
1054
Efficient Pseudo Code
/* *Author:johnsondu *time:2013-4-25 *meanning:求出约数和n^m的约数和,快速模取幂,扩展欧几里德,素数筛选 *problem:LightOj
1054
*url
zone_programming
·
2013-04-26 15:00
ZJU-PAT
1054
. The Dominant Color (20) 浙大2013年上机复试第一题
#pragmawarning(disable:4786) #include #include #include #include usingnamespacestd; intmain() { intm,n; while(scanf("%d%d",&m,&n)!=EOF) { inti,j; strings; mapans; map::iteratorp;
Matrix_Reloaded
·
2013-04-18 13:00
ACM
pat
ZJU
poj
1054
搜索
刚没看清题目,跳必须是从外面跳进来,然后跳出去的,一直WA不止谁说是dp的,完全扯淡#include #include #include #include #include #include usingnamespacestd; #defineN5050 structpoint { intr,c; }p[N]; boolmat[N][N]; intr,c,n; intans; boolcmp(po
Jackyguo1992
·
2013-03-26 21:00
hdu
1054
匈牙利算法/最小覆盖点
pid=
1054
#include #include #include usingnamespacestd; structarcnode { intadjvex; arcnode*next; arcnode
JustSteps
·
2013-03-09 13:00
MySQL Having的使用方法
FROM s, spj WHERE s.Sno = spj.Sno AND Numqty >1000 GROUP BY spj.Sno 这样遇到的问题是 SUM 别名作为查询条件提示#
1054
free0007
·
2013-02-21 10:00
having
[置顶] BIT
1054
Largest prime factor
题意:在素数表中2的位置上1,3的位置是2,5的位置上3给一个数,问他的最大素数因子在素数表中的什么位置开始用素数筛选出来后试除果断TLE了。。。改一下素数筛选素数筛选的过程中,定义一个数组,初始代表所有的数都为素数然后一个一个筛掉这里改了一下筛法,代码中讲解#include #include #include usingnamespacestd; #defineMAX1000000 intf[M
zhangwei1120112119
·
2013-02-03 18:00
Adobe Dreamweaver CS5 官方简体中文破解版
1192-
1054
-1339-8780-0297-65651192-1
submaze
·
2013-01-13 14:00
dreamweaver
adobe
Adobe Dreamweaver CS5 官方简体中文破解版
1192-
1054
-1339-8780-0297-65651192-1
submaze
·
2013-01-13 14:00
dreamweaver
adobe
Adobe Dreamweaver CS5 官方简体中文破解版
1192-
1054
-1339-8780-0297
submaze
·
2013-01-13 14:00
Adobe
Dreamweaver
HOJ题目分类
1043MayaCalendar
1054
GamePrediction1057MileageBank
码蹄疾
·
2012-12-07 20:06
Data
structure
and
Algorithm
上一页
11
12
13
14
15
16
17
18
下一页
按字母分类:
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
其他