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
1466
poj
1466
Girls and Boys 最大独立集
根据性别分为两个集合,然后求最大独立集。由于题目没有给出性别,可以不划分集合,每个集合都为n个,求最大匹配数,最后除2即可。 #include <iostream> #include <cstring> #include <cstdio> using namespace st
·
2015-10-31 19:16
poj
HDU
1466
计算直线的交点数
Problem Description 平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。 比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。 Input 输入数据包含多个测试实例,每个测试实例占一行,每行包含一个正整数n(n<=20),n表示直线的数量. Output 每个
·
2015-10-31 15:39
HDU
二分图的独立数
二分图的最大独立数+poj 题目汇总 入门题:POJ
1466
想用C练练手,于是抄的是这里,为了省事抄的是现成的C++,但是不知为什么TLE了,这位的代码可以AC,理论上他用的邻接矩阵更慢才对啊。
·
2015-10-31 13:43
二分图
poj
1466
二分图
左右互搞。要除以(roll神 教的) 二分图中 最大独立点集 = 顶点 - 最大匹配 #include <cstdio> #include <cstring> #include <algorithm> #include <climits> #include <string> #include <io
·
2015-10-31 10:41
poj
G题 hdu
1466
计算直线的交点数
pid=
1466
计算直线的交点数 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/
·
2015-10-31 09:44
HDU
BNUOJ 1585 Girls and Boys
Original ID:
1466
64-bit integer IO format: %lld Java cl
·
2015-10-31 08:25
ls
HDU
1466
计算直线的交点数 dp晕
dp[a][b]:表示有a条边的时候,有b个交点。状态方程:若dp[a][b]=1,则dp[a+k][b+(n-pingxing)*pingxing]=1;#include #include intmain() { intn,f[25],dp[25][200];//[平行边的数量][交点数量] memset(dp,0,sizeof(dp)); for(inti=0;i<=20;i++)dp[i][
Triple_WDF
·
2015-10-30 17:00
计算直线的交点数(hdu
1466
简单的dp)
题意:平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。 思路:动态规划,想办法记忆化搜索,当前状态和之前状态结合起来 dp[i][j] i是有i条直线 j代表交点个数 假设有n条直线,前n-1条直线的所有交点都知道 假设第n条线段与前n-1条平行 n条平行 交点数 0
·
2015-10-30 13:34
HDU
历史上的今天--达·芬奇诞生日
1466
年,到佛罗伦萨的画坊中学艺。
·
2015-10-28 09:35
Dynamic Programming 练习(题源 hdu
1466
, 计算直线的交点数)
有空练了练动态规划,用来练习的题目是航电的
1466
题,链接如下 http://acm.hdu.edu.cn/showproblem.php?
·
2015-10-27 15:12
hdu
1466
计算直线的交点数 递推
以前做这道题目的时候,花了好长时间找规律,感觉十分高大上,今天回顾这个题目的时候,突然有了顿悟, 有了递推的思想就容易解决了。 题意:给你n条直线,问:输出这些直线所有相交情况下的交点个数(升序输出) 解题思路:我们可以从n-1条直线相交的情况推导出n条直线的相交情况,考虑到直线的关系不是相交就是平行,我们可以推倒一下n=4的情况: 已知n=3时有0,2,3; (1):第四条
·
2015-10-27 15:21
HDU
九度OJ 1116:加减乘除 (基础题)
时间限制:1秒内存限制:32兆特殊判题:否提交:
1466
解决:902题目描述:根据输入的运算符对输入的整数进行简单的整数运算。运算符只会是加+、减-、乘*、除/、求余%、阶乘!六个运算符之一。
thudaliangrx
·
2015-10-23 22:00
C语言
OJ
九度
poj
1466
Girls and Boys 二分图的最大匹配
id=
1466
Description In the second year of the university somebody started a study on the
·
2015-10-23 09:57
poj
HDOJ
1466
计算直线的交点数 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5744 Accepted Submission(s): 2554 Problem Description 平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。
·
2015-10-23 08:30
OJ
HDU
1466
计算直线的交点数
Description 平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。 Input 输入数据包含多个测试实例,每个测试实例占一行,每行包含一个正整数n(n<=20),n表示直线的数量. Output 每个测试实例对应一行输出,从小到大列出所有相交方案,其中每个数为可能的交点数,每行的整数之
·
2015-10-23 08:42
HDU
借助旧问题回顾动态规划
一切要从一个问题说起,听说那是一道简单的动态规划题,于是我在半夜试着写写,谁知道到了第二天也没有写出来,看着45%的AC率,我想自己的动态规划已经忘得差不多了(呵呵,应该说没有学好)原问题:hdu
1466
theArcticOcean
·
2015-10-09 22:00
dp
hdu
1466
计算直线的交点数&2050 折线分割平面【DP】
ProblemDescription平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。 Input输入数据包含多个测试实例,每个测试实例占一行,每行包含一个正整数n(n 无交点;2、第四条与其中两条平行,交点数为(n-1)*1+0=3;3、第四条与其中一条平行,这两条平行直线和另外两点直线的交点数为(n-2)*2=4,而
zhou_yujia
·
2015-10-08 19:00
dp
HDU
poj
1466
Girls and Boys
id=
1466
题意:给出n个人,以及每个人可能成为情侣的对象……问有几个人没有办法找到另一半思路:……非常裸的一道题目,图都给出来了,求最大独立点集,拆点加匈牙利算法求最大匹配就可以了最大独立点集=点数
csdn364988181
·
2015-09-22 23:00
ACM
图论
uva
1466
- String Phone(2SAT)
题目链接:uva
1466
-StringPhone对于每个位置而言,只有对定角的两个位置可能共存,所有枚举每个位置后可以用dfs预处理出每个地方是哪两个角有可能,然后做2SAT。
u011328934
·
2015-09-12 22:00
HDU
1466
计算直线的交点数
计算n条直线的交点数:计算1条直线平行(即都不平行),交点为dp[n-1][j+1*(n-1)];计算2条直线平行,交点为dp[n-2][j+2*(n-2)]; ......计算i条直线平行,交点为dp[n-i][j+2*(n-2)]; ......另外还有dp[i][j*(i-j)]的交点(刚开始
llwwlql
·
2015-09-09 19:00
hdu
1466
(dp)
ProblemDescription平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。 Input输入数据包含多个测试实例,每个测试实例占一行,每行包含一个正整数n(n #include #include #include usingnamespacestd; booldp[21][200]={{0}}; intmain
martinue
·
2015-09-07 20:00
dp
ACM
大二
HDU
1466
计算直线的交点数(dp)
Description平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。Input输入数据包含多个测试实例,每个测试实例占一行,每行包含一个正整数n(n #include #include #include usingnamespacestd; booldp[22][222]; voidgoto_dp() { for(i
V5ZSQ
·
2015-09-04 08:00
POJ
1466
&& ZOJ 1137--Girls and Boys【二分图 && 最大点独立集】
GirlsandBoysTimeLimit: 5000MS MemoryLimit: 10000KTotalSubmissions: 11134 Accepted: 4981DescriptionInthesecondyearoftheuniversitysomebodystartedastudyontheromanticrelationsbetweenthestudents.Therelatio
hpuhjh
·
2015-08-25 20:00
HDOJ
1466
计算直线的交点数题目不是很难,根据点的产生过程,很容易知道,对于n条直线,其产生的交点数在[0,(n-1)n/2]中。其中,当所有的直线都平行时,交点为0;当所有的直线两两相交时,产生的交点数是(n-1)n/2,很容易证明,假设n条直线的两两相交时产生的交点数为s(n),容易得到递推关系式,s(n)=s(n-1)+n-1,即已知n-1条直线两两相交产生的交点数时,第n条直线会与剩下的n-1条直线产
u011000290
·
2015-08-10 18:00
动态规划
HDU
1466
直线交点情况
的BestCoder(有米!)计算直线的交点数TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):8881 AcceptedSubmission(s):4006ProblemDescription平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点
DoJintian
·
2015-08-09 11:00
ACM
HDU
开发人员应关注的20个jQuery网站/博客
http://blog.jobbole.com/
1466
/ 2. 10个优秀的移动Web应用开发框架http://blog.jobbole.com/1436/ 3.
Slp415
·
2015-05-14 16:00
开发人员应关注的20个jQuery网站/博客
http://blog.jobbole.com/
1466
/ 2. 10个优秀的移动Web应用开发框架http://blog.jobbole.com/1436/ 3.
Slp415
·
2015-05-14 16:00
hdu
1466
计算直线的交点数 动态规划第一题
计算直线的交点数TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):8578 AcceptedSubmission(s):3857ProblemDescription平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交
chaiwenjun000
·
2015-04-21 18:00
dp
动态规划
ACM
HDU
POJ
1466
Girls and Boys【二分图最大独立集】
id=
1466
题目大意:有N个学生,他们之间的某些人比较暧昧,只有认识的人能组成一个集合。问:最多能组成多少个集合,使得这几个集合之间的学生都没有任何关系。
u011676797
·
2015-04-01 22:00
POJ 3692 Kindergarten 题解 《挑战程序设计竞赛》
参照《POJ
1466
GirlsandBoys》的做法即可:#include
hankcs
·
2015-01-23 22:00
POJ
1466
Girls and Boys 题解 《挑战程序设计竞赛》
POJ
1466
GirlsandBoysFFF团:有V个学生,每行数据x:(n)yz...表示学生x与另n个人:y和z……有一腿(贵圈真乱)。不知为何,你手中突然多出了火把和汽油。
hankcs
·
2015-01-22 19:00
HDOJ 计算直线的交点数
1466
计算直线的交点数TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):8389 AcceptedSubmission(s):3772ProblemDescription平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交
ydd97
·
2015-01-02 22:00
POJ
1466
-Girls and Boys(最大独立集)
题目链接题意:n个人,每个人有一个爱慕的集合,现在要挑出一些人,使得集合中没有人两两爱慕,问这个集合最大人数是多少思路:每个人拆成两点,爱慕和被爱慕,建图,求出二分图最大匹配,因为是两两匹配,然后人数n-最大匹配数/2就是最大独立集代码:#include #include #include #include #include usingnamespacestd; constintMAXN=51
u011345461
·
2014-11-03 16:00
HDU -
1466
计算直线的交点数 (dp)
来自杭电ppt上面的一道题目。n条直线互不平行且无三线共点的最多交点数max=1+2+……(n-1)=n(n-1)/2,所以n=20的话,最大的交点数是190本题是求有多少种交点数:容易列举出N=1,2,3的情况:00,10,2,3如果已知无交点;2、第四条与其中两条平行,交点数为(n-1)*1+0=3;3、第四条与其中一条平行,这两条平行直线和另外两点直线的交点数为(n-2)*2=4,而另外两条
HelloWorld10086
·
2014-11-02 16:00
HDU
1466
计算直线的交点数
POJ
1466
Girls and Boys(二分图最大独立集)
POJ
1466
GirlsandBoys(二分图最大独立集)http://poj.org/problem?
u013480600
·
2014-08-17 12:00
Algorithm
算法
ACM
poj
1466
--Girls and Boys
GirlsandBoysTimeLimit: 5000MS MemoryLimit: 10000KTotalSubmissions: 10242 Accepted: 4540DescriptionInthesecondyearoftheuniversitysomebodystartedastudyontheromanticrelationsbetweenthestudents.Therelatio
u013015642
·
2014-06-15 19:00
HDU
1466
计算直线的交点数 【DP】+【经典题】
计算直线的交点数TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):7923 AcceptedSubmission(s):3529ProblemDescription平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交
u012846486
·
2014-06-02 15:00
HDU1466
poj
1466
具体:http://www.verydemo.com/demo_c92_i155183.html 这题考察的是最大独立集问题, 算是裸的二分匹配, 只要在计算上添加一个n - count/2 就可以直接得出结果了。 不管是男的还是女的都一样,因为你男的算一边,女的再算一遍,这样算两遍, 不管你这个学号是男的还是女的,一点影响都没有。 #include #include
lonelone11418485
·
2014-05-30 01:00
poj
递推—杭电
1466
计算直线的交点数(待解决)
pid=
1466
计算直线的交点数TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission
u013263923
·
2014-04-14 10:00
九度
1466
:排列与二进制
题目描述: 在组合数学中,我们学过排列数。从n个不同元素中取出m(m<=n)个元素的所有排列的个数,叫做从n中取m的排列数,记为p(n, m)。具体计算方法为p(n, m)=n(n-1)(n-2)……(n-m+1)= n!/(n-m)! (规定0!=1).当n和m不是很小时,这个排列数是比较大的数值,比如 p(10,5)=30240。如果用二进制表示为p(10,5)=30240
·
2014-03-07 20:00
二进制
POJ
1466
Girls and Boys (ZOJ 1137 )最大独立点集
id=
1466
题目大意:n个学生,他们中有的有关系,有的没有关系,求最多可以取出几个人,使得他们之间没有关系。思路:复制别人的。。。。。
murmured
·
2014-02-16 22:00
HDU
1466
计算直线的交点数
pid=
1466
ProblemDescription平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。
u013573047
·
2014-02-16 16:00
hdu
1466
计算直线的交点数
采用数组dp[i][j]。若dp[i][j]==1,则说明放i条直线有j个交点,则只需要把dp[n][i]从i=0到i=190扫一遍,因为20条直线最多有190个交点。转移为:要求i条直线有多少个交点,则此i条直线可以分为两组,一组是j条平行线,另外一组是i-j条自由线,则此种交法的交点数就为(i-j)*j+k(k为j条自由线的交点数)。#include #include intmain() {
u013365671
·
2014-01-03 22:00
dp
hdu
1466
:
如果有n条直线,最多可有n*(n-1)/2个交点。 如果i条线可以相加出j个交点,那么记f[i][j]=1;否则f[i][j]=0。 *当n=1时,方案为0 *当n=2时,方案为0,1 *当n=3时,方案为0,2,3 *当n=4时,4条平行:方案为0 * 3条平行:方案为3 * 2条平行:方案为4,5 * 1条平行:方案为6 *。。。 *当n=k时,k条平行:方案为0#inclu
u012861385
·
2013-11-17 21:00
POJ
1466
最大独立集入门
题意:n个学生,给你每个学生浪漫的学生学号(男女之间浪漫),问你找出一个最大的集合保证集合内的任意两个学生之间没有相互浪漫关系,输出最大集合的人数。注意:这里的浪漫边是双向的,如果1对2浪漫,那么2对1也浪漫,题意好像没说清楚,但我测了一下,是双向边。思路:最大独立集和最小点覆盖集是互补的,所以最大独立集==总人数n-最小点覆盖集,如果题目给你的是二分图那么直接二分匹配一下即可,但这题不是二分图,
c3568
·
2013-09-06 17:00
记两个非常好的查看ios设备nslog的工具,官方提供
1.0/#appbec2ce68mac版下载地址http://support.apple.com/kb/DL1465window版下载地址 http://support.apple.com/kb/DL
1466
慎道
·
2013-08-27 16:00
hdu4614 Vases and Flowers
VasesandFlowersTimeLimit:4000/2000MS(Java/Others)MemoryLimit:65535/32768K(Java/Others)TotalSubmission(s):
1466
AcceptedSubmission
u010422038
·
2013-08-25 22:00
hdu
1466
计算直线的交点数
题意:平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。分析:DP设状态:f[i][j]表示i条直线能否产生j个交点。有不同的交点数--->n条直线中有平行线。;n个点最多有n(n-1)/2个交点。i条直线中j(j #include constintmaxn=21; intf[maxn][191]; voidin
·
2013-07-27 20:00
HDU
hdu
1466
计算直线的交点数
题意:平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。分析:DP设状态:f[i][j]表示i条直线能否产生j个交点。有不同的交点数--->n条直线中有平行线。;n个点最多有n(n-1)/2个交点。i条直线中j(j #include constintmaxn=21; intf[maxn][191]; voidinit()
yew1eb
·
2013-07-26 14:00
poj
1466
二分匹配
//男生和女生匹配 //匈牙利算法 #include #include usingnamespacestd; #defineMAXN510 intmk[MAXN]; intn; intG[MAXN][MAXN]; intcx[MAXN],cy[MAXN]; intnx,ny; intans; intpath(intu) { for(intv=0;v>n) { memset(G,0,siz
Kevin_Samuel
·
2013-06-08 17:00
上一页
1
2
3
4
5
6
7
下一页
按字母分类:
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
其他