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
1595
习题5-6 对称轴 UVA
1595
#include#include#includeusingnamespacestd;constintMAX=100000000;//用一个vector到int的字典来存储所有的点,y值作为Key,相同y值的点被存入同一个vector里。//判断时,先计算第一个key值下的所有数的平均值,然后将之后的Key值下的平均值与它比较,只要有一个不相同则输出NO。//全相同则输出YESintmain(){i
dherorunner
·
2017-03-22 21:33
算法竞赛入门经典
模拟
uva
1595
Symmetry
题目Thefigureshownontheleftisleft-rightsymmetricasitispossibletofoldthesheetofpaperalongaverticalline,drawnasadashedline,andtocutthefigureintotwoidenticalhalves.Thefigureontherightisnotleft-rightsymmetr
FD丶grass
·
2017-01-22 15:38
sdut
1595
选夫婿2
#include#include#includeusingnamespacestd;structE{charname[27];inttall;}s[1007];intcmp(Ea,Eb){returna.tall=downt&&s[i].tall<=upt){f++;printf("%s%d\n",s[i].name,s[i].tall);}}if(f==0){printf("No\n");}re
just want to know
·
2016-11-06 15:25
sdut
ACM算法入门
Cpp环境【中山大学2004年集训队内部选拔赛】【CQYZOJ
1595
】小树
【问题描述】给定一棵边带权的有根树,树中包含n个结点(编号为0..n-1),其中根结点的编号为0。你的任务是在树中找出一个结点集合{a1,a2,…,am},集合需要满足如下三个条件:1)、根结点不在集合中,即0#include#include#definemaxn1005usingnamespacestd;intn,dist[maxn],dept[maxn];vectorg[maxn],w[max
cqyz_Lebmond
·
2016-10-28 20:38
数据结构之二
树形结构
难度评级
Greenhand
HDU
1595
find the longest of the shortest
findthelongestoftheshortestProblemDescriptionMaricaisveryangrywithMirkobecausehefoundanewgirlfriendandsheseeksrevenge.Sinceshedoesn'tliveinthesamecity,shestartedpreparingforthelongjourney.Weknowforeve
大烁就是要吃肉
·
2016-09-26 16:45
ACM
图论
(搜索)记忆化搜索
UVA
1595
(Symmetry)
SymmetrySymmetry#include#includeusingnamespacestd;intmain(){intt=0,n=0,x=0,y=0;cin>>t;for(inti=0;icoordinate;//关键字可重复的mapcin>>n;for(intj=0;j>x>>y;coordinate.insert(pair(x,y));}automap_it=coordinate.ce
Gaolex
·
2016-05-14 13:33
hdu
1595
find the longest of the shortest 最短路dijkstra+枚举
题目链接题意:给出n个点,m条边,求去除任意一条边的最长最短路。这题先用求一次最短路,记录下路径。如果去除的边不在路径上,那么最短路不变。所以我们只要考虑去除最短路上的边的情况。枚举最短路上的边删除,求最短路,注意要还原边。这题用spfa的邻接矩阵形式怎么也过不了,一直TLE。代码不变,换成dijkstra之后就能过了。ps:SPFA算法在负边权图上可以完全取代Bellman-ford算法,另外在
zchahaha
·
2016-04-06 16:00
枚举
最短路
HDU
dijkstra
最长最短路
Symmetry UVa
1595
(水题)
题目描述:Thefigureshownontheleftis left-rightsymmetric asitispossibletofoldthesheetofpaperalonga verticalline,drawnasadashedline,andtocutthefigureintotwoidenticalhalves.Thefigureontherightisnotleft-rights
chat_c
·
2016-02-11 15:00
uva
简单题
UVA
1595
multimap 的应用
这道题目的大意是给出一系列的点,问:是否能找到一个对称轴,使得所有点左右对称。这是multimap的简单应用,把纵坐标看作key,相应的所有点纵坐标相等的点的横坐标看作value,然后把value的值相加,除以点的个数,得到一个值,这个值可能就是对称轴,然后计算所有的点,看是否是相同的对称轴,思路比较简单。#include #include #include #include #inclu
咸咸的告别
·
2016-01-28 14:00
hdu
1595
find the longest of the shortest (Dijkstra+路径处理)
ProblemDescriptionMaricaisveryangrywithMirkobecausehefoundanewgirlfriendandsheseeksrevenge.Sinceshedoesn'tliveinthesamecity,shestartedpreparingforthelongjourney.Weknowforeveryroadhowmanyminutesittakes
wqy20140101
·
2016-01-11 15:00
ACM
最短路
杭电
5-6 UVA
1595
Symmetry对称轴
题目大意紫书和原文都讲的非常易懂清晰,观察给出的数据范围:不超过1000个点,每个点坐标范围在-10000到10000之间!直接暴力求解就可以了!整体思路:因为一撮点要轴对称的话,肯定有一个确定的对称轴,所以可以先找两个点,来确定对称轴,在一个一个扫描所有的点,看看是不是对称!为了方便,可以直接找最左上和最右上的两个点,来确定对称轴!有一个技巧:因为对称轴是要除以二的,不妨存点的时候,直接存坐标的
aozil_yang
·
2015-12-17 11:00
C语言
uva
编译器错误信息 CS
1595
编译器错误信息:CS
1595
:已在多处定义“SCM_HUB.SCM_HUB.Global”;使用“c:\WINNT\Microsoft.NET\Framework\v1.1.4322\TemporaryASP.NETFiles
·
2015-12-09 11:20
编译器
UVa
1595
-对称轴
分析:这个题有点难度了,拿到这个题,第一感觉就是枚举,然而我就跪了,很明显这不现实,对称轴,贵在对称这两个字,如果有对称轴,那他一定在x坐标最大和最小的中间,这样便只需寻找两个数,x的坐标和是对称轴的两倍,y坐标相同便可,暴力吧。还有一个技巧,为了防止对称轴的x坐标出现小数,所以把每个横坐标*2;代码如下:#includeintx[1005],y[1005],n,mx;intpanduan(int
qq_32036091
·
2015-12-06 23:00
uva
1595
慕课网-安卓工程师初养成-6-4 练习题
来源:http://www.imooc.com/ceping/
1595
下列数组的初始化正确的是() A int[ ] score = new int[ ]; B int score
·
2015-11-13 09:04
安卓
HDU
1595
SPFA 题意:给定一张图,从1到n。 求1到n的最短路,但是可能存在某条路被阻断了,即为inf了。 这条路必定是存在最短路中。所以枚举最短路中的路径。。。。 View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 #include
·
2015-11-13 06:41
HDU
hdu
1595
find the longest of the shortest
pid=
1595
这道题我用spfa在枚举删除边的时候求最短路超时,改用dijkstra就过了。
·
2015-11-13 05:14
test
C语言技巧:怎样把数组作为参数传递给函数?
来源:http://see.xidian.edu.cn/cpp/html/
1595
.html?
·
2015-11-13 01:48
参数传递
poj
1595
水题
题意:输入n, 和c 统计1 - n 有多少个素数为cnt 若 2*c > cnt 则将素数全部输出 否则分支判断: 若cnt 为偶数,则从中心开始输出2*c 个 若cnt 为奇数,则从中心开始输出2*c-1个 1 /* 2 题意:输入n, 和c 3
·
2015-11-11 10:18
poj
HDU
1595
find the longest of the shortest[最短路]
HDU
1595
,题意是给N个点,M条边的稠密图,每条边有个路程信息和一个时间信息(这里路程信息就是1),从点1到点N,任意删掉一条边后(保证任意删掉一条边,点1都可达点N),从点1到点N的最短路中的最长时间
·
2015-11-11 04:29
test
joj1011
had a Venn diagram Result TIME Limit MEMORY Limit Run Times AC Times JUDGE 3s 524288K 3990
1595
·
2015-11-11 01:16
OJ
BZOJ3560: DZY Loves Math V
6=2*3; 10=2*5; 15=3*5; 对应答案:
1595
=5*11*29; 其中: 5=((1+2)*(1+2)*1*(2-1)+1)/2 11=((1+3)*1*(1+3)*(3-
·
2015-11-11 01:28
Math
PKU 水题集
1298 1316 1318 1326 1338 1350 1450 1477 1484 1493 1504 1517 1528 1543 1552 1575 1580
1595
·
2015-11-08 17:21
pku
hdu
1595
最短路算法dijkstra
find the longest of the shortest Time Limit: 1000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2094 Accepted Submi
·
2015-11-07 12:43
dijkstra
“CS
1595
: 已在多处定义”错误详解
我最近又找到了一个方法,可能是最简单,而且最有效的。 就是把所有命名空间名称改掉,只要和原来不一样就可以。 发现这个也是在没有办法的情况最坏的办法,没想到是最有效的。我基本上把下面的方法都试过了,还是不行,权限配置也都改了,也不行,我觉得以下的方法只能参考,因为我们平常都是做WEB程序,不可能不用到mscorelib.dll。 以下是微软的解释和我的理解 http://suppor
·
2015-11-07 12:08
错误
poj
1595
题意:给定你一个数n,让你求出1-n内有多少个素数,再给你一个数d,如果2*d大于素数的个数则全部输出; 否则,如果个数为单数,输出2*d - 1个并且以中间那个素数为中心分别向两边输出d-1个; 如果偶数个,输出2*d个,也是以中间那个素数为中心向两边扩展; View Code #include<iostream> #include<cstdio> #
·
2015-11-05 08:47
poj
UVa
1595
,Symmetry
这题居然是1A过的.....最近无比失落的心情顿时愉悦起来~ 将数据全部读入 先用二维数据来存储坐标(先把题做出来再说= =) 题目中的x,y的坐标范围是-1W到1W....在数组下标里是不能用负数保存的(当然你偏用map当额没说= =),其实可以把x坐标左移1W个单位,这样最小坐标就从0开始了 然后随便找一行y(当然保证该行至少存在一点),那么可以确定这条竖线mid 枚举每一行,以mi
·
2015-11-02 15:59
try
poj
1595
素数筛 View Code #include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> #include <cmath> using namespace std; #define maxn 1005 #define m
·
2015-11-02 10:33
poj
UVa
1595
(水题) Symmetry
颓废的一个下午,一直在切水题,(ˉ▽ ̄~) 首先如果这些点是对称的话,那么它们的对称轴就是x = m,m是横坐标的平均值。 把这些点放到一个集合里,然后扫描每个点,计算出它关于x = m的对称点,看这个点是否在集合里面。 如果有一个不在的话,说明不能构成对称图形。 1 #include <cstdio> 2 #include <algorithm>
·
2015-11-01 10:53
try
POJ
1595
Prime Cuts
Prime Cuts Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8245 Accepted: 3151 Description A prime number is a counting number (1, 2, 3, ...) that is
·
2015-10-31 15:51
Prim
poj
1595
Prime Cuts
大一刚搞的时候敲的 1 #include "stdio.h" 2 #include "stdlib.h" 3 #include "math.h" 4 int main() 5 { 6 int i, j, c, prime[1000], b[1000], m, n, t, min, max; 7
·
2015-10-31 09:18
Prim
POJ
1595
:Prime Cuts
Description 一个素数是一个只能被1和自己整除的数(这里1是素数)。在这个问题中,你需要写一个程序,这个程序能够在[1,N]范围的素数列表中截取一部分素数。你的程序将读入一个数字N,判定[1,N]中的素数列表L;如果L的长度是偶数,则输出最中间的C*2个素数,如果L的长度是奇数,则输出最中间的C*2-1个素数。 Input 每个输入集都在一行中,且包含两个数字,第一个数字是N($1
·
2015-10-31 08:18
Prim
有关编译器错误信息: CS
1595
的补充问题 已在多处定义“CustomControls.FirstControl”
已在多处定义“CustomControls.FirstControl 估计你有重复或老的assembly,删去bin里的DLLs,重新编译,为放心起见,同时删除<br> C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files<br> 里面的
·
2015-10-30 11:36
first
块设备驱动编写总结一(ZT)
http://www.cublog.cn/u/
1595
/showart_2209627.html 前一段时间一直在Linux下搞块设备驱动的开发,实现了多个块设备模块,现将块设备驱动开发的一些方法总结一下
·
2015-10-27 16:46
总结
关于ASP.NET CS
1595
问题
Compiler Error CS
1595
While changing namespaces and filenames at the request of Zorka, I encountered
·
2015-10-27 15:38
asp.net
win7下用SSH连接linux虚拟机
PUTTY,SecureCRT以及Fterm等)可以google下载的了.步骤:1,有人说首先要在VirtualNetworkEditor做NAT的端口映射,其实是不需要的;ps-e|grep ssh
1595
Mikesworld
·
2015-10-27 13:39
ssh
ubuntu
HDU
1595
find the longest of the shortest
在最短的时间最长。 含义非常模糊标题,做4小时度过理解问题……对中国不会死! !。 它说,从 N 至 1 可能有一些办法的道路被封锁,不能。乞讨N 至 1 在最短的时间最长。 一般想法就是枚举 每条路不能通过时候的最短路。时间花费太高。 m*O(SPFA)。 能够先做一次SPFA。把最短路径记录下来。 其它的路无论是不是 封堵了,最短路都是这么多。 然后再
·
2015-10-23 08:48
test
测绘类投稿指南
《测绘学报》 刊 期:季刊 刊 号:ISSN 1001-
1595
/ CN 11-2089/P 主管单位:中国科协 主办单位:中国测绘学会
·
2015-10-21 13:35
类
UVa-
1595
- Symmetry
在看了别人的代码后发现有很多可以避免出现精度问题的方法(如坐标都乘2等) 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<cmath> 5 using namespace std; 6 const int maxx=1010;
·
2015-10-21 13:39
try
编译错误CS
1595
编译器错误信息: CS
1595
: 已在多处定义“BigTeam.Security.Admin.Controls.UserLists_ascx”;使用“c:\WINDOWS\Microsoft.NET\Framework
·
2015-10-21 10:14
编译
POJ
1595
Prime Cuts(素数切)
PrimeCutsTimeLimit:1000MS MemoryLimit:10000KTotalSubmissions:10934 Accepted:4156DescriptionAprimenumberisacountingnumber(1,2,3,...)thatisevenlydivisibleonlyby1anditself.Inthisproblemyouaretowriteaprog
helloiamclh
·
2015-10-20 22:00
HDU
1595
find the longest of the shortest
就是简单求以下这个式子,所以直接按照公式枚举就好了。maxe∈path(sp(V,E))sp(V,E/{e})#include #include #include #include #include #include usingnamespacestd; #defineedge(i,u)for(inti=head[u];i!=-1;i=graph[i].next) #definerange(
speedcell4
·
2015-10-01 02:00
POJ
1595
&& HDU 1319 Prime Cuts(数论)
Description给定你一个数n,让你求出1-n内有多少个素数,再给你一个数d,如果2*d大于素数的个数则全部输出;否则,如果个数为单数,输出2*d-1个并且以中间那个素数为中心分别向两边输出d-1个;如果偶数个,输出2*d个,也是以中间那个素数为中心向两边扩展Input多组输入,每组用例包括两个数n和d,以文件尾结束输入Output对于每组用例,按题目要求输出对应素数,每组用例后加一空行Sa
V5ZSQ
·
2015-08-25 10:00
特征点匹配方法(SIFT匹配)的一点见解
特征点匹配方法(SIFT匹配)的一点见解2014-6-5阅读
1595
评论0一、特征点(角点)匹配 图像匹配能够应用的场合非常多,如目标跟踪,检测,识别,图像拼接等,而角点匹配最核心的技术就要属角点匹配了
v_JULY_v
·
2015-08-24 14:00
南邮 OJ
1595
确定进制
确定进制时间限制(普通/Java) : 1000MS/ 3000MS 运行内存限制:65536KByte总提交:442 测试通过:89 比赛描述6+9=12 对于十进制来说是错误的,但是对于13进制来说是正确的。即,6(13)+9(13)=12(13), 而 12(13)=1× 131 +2 × 130 =15(10)。你的任务是写一段程序读入三个整数p、q和 r,然后确定一
changshu1
·
2015-08-06 09:00
ACM
南邮OJ
确定进制
hdu
1595
find the longest of the shortest 最短路
//给一个无向图,问删除一条边,使得从1到n的最短路最长 //问这个最长路 //这个删除的边必然在最短路上,如果不在,那么走这条最短路肯定比其他短 //枚举删除这条最短路的边,找其最长的即为答案 #include #include #include usingnamespacestd; constintmaxn=1110; constintinf=0x3f3f3f3f; structEdge {
cq_pf
·
2015-08-01 11:00
最短路
【剑指Offer面试题】 九度OJ1520:树的子结构
pid=1520题目1520:树的子结构时间限制:1秒内存限制:128兆特殊判题:否提交:
1595
解决:380题目描述:输入两颗二叉树A,B,判断B是不是A的子结构。
zhoubin1992
·
2015-07-30 21:00
面试题
树的子结构
剑指offer
[UVA
1595
]Symmetry
题目链接:[UVA
1595
]Symmetry题意分析:给出若干个点,问:这些点是否是左右对称的。解题思路:对x轴排序,然后最后一个点的坐标+第一个点的坐标=对称轴坐标的两倍。然后对两边分别y轴排序。
CatGlory
·
2015-07-29 21:00
实现
uva
POJ-
1595
//方法有点笨,还是莫比乌斯算法求素数,这个方法我用了几年了,很好用,我们全家都用它。AC代码:#include #include #definemax1005 intprime[max]; intisprime[max]; intvis[max]; inta[max]; voidInit() { inti,j,cnt=0; memset(vis,0,sizeof(vis)); memset(is
zyx520ytt
·
2015-07-18 17:00
neuoj
1595
#include#includeusingnamespacestd;typedeflonglongLL;constintMOD=1e6+7;LLfac[110];inta[110],b[110];voidinit(){ for(inti=0;ib[i]) return1; elseif(a[i]0?(aa+MOD-bb)%MOD:(bb+MOD-aa)%MOD); } return0;
u014451076
·
2015-06-16 23:00
康拓展开
poj
1595
prime cuts(快速筛选)
题意: 给定一个数字N,将1到N中的所有质数按照中心值为c的规定输出,规则详见题目。本题不难,但是要注意这里1也算是素数列中的一员。其它的都是小事儿啦,用快速筛选找到1--1000内所有的素数和合数。然后A了。#include #include usingnamespacestd; boolnotpri[1001]; intprime[1001],cnt=0; voidgetprime(){//快
theArcticOcean
·
2015-05-24 08:00
poj
上一页
1
2
3
4
5
6
下一页
按字母分类:
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
其他