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
Suspects
POJ 1611 The
Suspects
【并查集】
解题思路:一共给出 n个人,m组,接下来是m组数据,每一组开头是该组共有的人 num,则接下来输入的num个数,这些数是一组的 又因为最开始只有编号为0的人携带有病毒,且只有同一组的人会相互传染,问最后一共有多少人携带有病毒,则问题简化为求含有0那一组一共有多少个人。 反思:最开始把对应每输入一组的数据用数组来放,发现 int a[30001]编译不过; 然后就用一个while循环来输入,还
·
2015-11-07 14:39
poj
The
Suspects
(简单的并查集)
Description Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best st
·
2015-11-07 11:41
并查集
ZOJ1789(The
Suspects
)j简单并查集
The
Suspects
Time Limit: 1 Second Memory Limit: 32768 KB Severe acute respiratory
·
2015-11-05 08:39
并查集
pku1611 并查集
题目链接:The
Suspects
很简单的一道并查集,关键在如果保存每个集合的元素个数和如何合并处理。
·
2015-11-03 22:19
并查集
POJ 1611 The
Suspects
第一道并查集,听起来很高大上的样子,其实也不难理解 我感觉并查集的精髓就在那个路径压缩上面,将叶子节点直接指向根 并:将两个集合合并在一起 查:查询某个元素是否在该集合中 题意:已知0号同学染病了,那么和他同在一个集合的同学也都可能染病了,输出可能染病的总人数 标准的并查集,模板题 1 //#define LOCAL 2 #include
·
2015-11-02 11:33
poj
poj 1611 The
Suspects
(并查集)
http://poj.org/problem?id=1611 简单入门并查集, 以前已经做过,但是代码不太好。DP优化搞上火了,做做别的换换脑子... 以前代码 Memory: 356K Time: 32MS #include<cstdio> usingnamespace std
·
2015-11-01 16:34
poj
pku 1611 The
Suspects
并查集的应用
http://poj.org/problem?id=1611 思路:统计出和0能够联系在一起的点,然后输出其个数 View Code #include <cstdio>#include <iostream>#define maxn 30004using namespace std;int f[maxn],num[maxn];//num记录与0有联系的个数int
·
2015-11-01 14:23
并查集
POJ 1611 The
Suspects
:并查集
Description Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best str
·
2015-11-01 13:37
poj
POJ 1611 The
Suspects
The
Suspects
Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 
·
2015-11-01 08:00
poj
poj 1611 The
Suspects
The
Suspects
Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 
·
2015-10-31 19:13
poj
Poj 1611 The
Suspects
The
Suspects
Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 14589
·
2015-10-31 15:48
poj
【原】 POJ 1611 The
Suspects
并查集 解题报告
http://poj.org/problem?id=1611 方法: 由于需要求得0元素所在划分的元素数,所以采用union by size的方法 将所有等价元素union到一起,然后再输出0元素所在划分的元素数 注意: union时需要事先判定两元素是否已经在同一个划分中,不然会出错 Description Severe acute respiratory synd
·
2015-10-31 11:38
poj
POJ---1611 The
Suspects
[并查集]
The
Suspects
Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 15580
·
2015-10-31 11:49
poj
POJ 1611 The
Suspects
(并查集,简单)
The
Suspects
Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 
·
2015-10-31 11:45
poj
poj1611
The
Suspects
Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 10794
·
2015-10-31 10:12
poj
The
Suspects
(流感疑似病人)
poj 1611 题目大意:0号学生是流感疑似病人,找出与0接触及与0间接接触的人(与0接触的人接触的人)的个数 解决:并查集,找出与0同在一个集合的所有元素的个数 #include <iostream> #include <cstring> using namespace std; int num[30005]; bool mark[30005]; in
·
2015-10-31 10:28
SP
POJ1611-The
Suspects
-ACM
The
Suspects
Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 23002
·
2015-10-31 09:38
ACM
PKU POJ 1611解题报告(并查集)
并查集学习-- 并查集详解 The
Suspects
Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 5572
·
2015-10-31 08:30
poj
并查集 分类: 并查集 2015-07-09 16:32 0人阅读 评论(0) 收藏
The
Suspects
Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 
·
2015-10-28 08:58
并查集
Codeforces Round #298 (Div. 2)
The teacher
suspects
that students with a
·
2015-10-28 08:53
codeforces
hdu 1611 The
Suspects
(第一道并查集)
#include<stdio.h> const int MAX=30000; int n,m,k; int parent[MAX+10]; int total[MAX+10]; //total[GetParent(a)] 是a所在的group的人数 int GetParent(int a) {//获取a的根,并把a的父节点改为跟 if(parent[a]!=a)
·
2015-10-27 15:48
HDU
poj 1611 The
Suspects
(并查集)
The
Suspects
Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 
·
2015-10-23 08:52
poj
POJ1611 The
Suspects
: 并查集入门
#include<iostream> using namespace std; #define Size 30000 int Pre[Size+1], Sum[Size+1];// Sum[i] 表示 第i组 的人数 int Get_Pre( int a ) { if( Pre[a]!=a ) a = Get_Pre( Pre[
·
2015-10-23 08:31
poj
Poj1611The
Suspects
A - The
Suspects
Time Limit: 1000 MS Memory Limit: 20000 KB 64-bit integer IO format
·
2015-10-21 11:03
poj
POJ 1611 The
Suspects
并查集
严重急性呼吸系统综合症(SARS),一种原因不明的非典型性肺炎,从2003年3月中旬开始被认为是全球威胁。为了减少传播给别人的机会,最好的策略是隔离可能的患者。在Not-Spreading-Your-Sickness大学(NSYSU),有许多学生团体。同一组的学生经常彼此相通,一个学生可以同时加入几个小组。为了防止非典的传播,NSYSU收集了所有学生团体的成员名单。他们的标准操作程序(SOP)如下
qiuxueming_csdn
·
2015-09-29 16:00
并查集
思路特殊
POJ1611:The
Suspects
【并查集】
TheSuspectsTimeLimit:2000/1000ms(Java/Other) MemoryLimit:40000/20000K(Java/Other)TotalSubmission(s):1 AcceptedSubmission(s):1ProblemDescriptionSevereacuterespiratorysyndrome(SARS),anatypicalpneumo
lin14543
·
2015-09-25 17:00
poj
并查集
poj-1611-The
Suspects
(并查集)
TheSuspectsTimeLimit:1000MS MemoryLimit:20000KTotalSubmissions:28173 Accepted:13725DescriptionSevereacuterespiratorysyndrome(SARS),anatypicalpneumoniaofunknownaetiology,wasrecognizedasaglobalthreatinm
qq_29963431
·
2015-09-20 11:00
poj1611 The
Suspects
http://poj.org/problem?id=1611DescriptionSevereacuterespiratorysyndrome(SARS),anatypicalpneumoniaofunknownaetiology,wasrecognizedasaglobalthreatinmid-March2003.Tominimizetransmissiontoothers,thebestst
aonaigayiximasi
·
2015-09-10 20:00
Codeforces 156b
Suspects
题意:询问n个嫌疑人,每个人有两种回答,+i和-i,+i表示第i个人是罪犯,-i表示第i个人不是罪犯,每个人能且只能回答一次,已知有m个人说的是实话,问第i个人说的是实话还是谎话,或者不能确定.思路:这个题其实重点就是根据有m个人说实话去判断谁是罪犯.朴素的思路就是假设第i个人是罪犯,然后扫描所有人的回答,检测是否有m个人在说实话.但是这样复杂度是O(n2).接下来就是如果去优化这个思路.假设第i
lxc779760807
·
2015-09-08 22:00
水题
codeforces
POJ 1611 The
Suspects
(并差集)
链接:http://poj.org/problem?id=1611TheSuspectsTimeLimit:1000MSMemoryLimit:20000KTotalSubmissions:27854Accepted:13583DescriptionSevereacuterespiratorysyndrome(SARS),anatypicalpneumoniaofunknownaetiology,
hellohelloC
·
2015-08-29 16:00
POJ 1611 The
Suspects
POJ1611TheSuspectsDescriptionSevereacuterespiratorysyndrome(SARS),anatypicalpneumoniaofunknownaetiology,wasrecognizedasaglobalthreatinmid-March2003.Tominimizetransmissiontoothers,thebeststrategyistose
qq_21120027
·
2015-08-14 21:00
poj
并查集
The
Suspects
poj 1611 【并查集】
DescriptionSevereacuterespiratorysyndrome(SARS),anatypicalpneumoniaofunknownaetiology,wasrecognizedasaglobalthreatinmid-March2003.Tominimizetransmissiontoothers,thebeststrategyistoseparatethesuspectsf
yuzhiwei1995
·
2015-08-13 15:00
poj 1611 The
Suspects
(简单并查集)
题目:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=10536Description严重急性呼吸系统综合症( SARS), 一种原因不明的非典型性肺炎,从2003年3月中旬开始被认为是全球威胁。为了减少传播给别人的机会, 最好的策略是隔离可能的患者。在Not-Spreading-Your-Sickness大学( NSYSU)
theArcticOcean
·
2015-08-10 11:00
poj
并查集
POJ 1611The
Suspects
并查集
我会说之前的方法哪儿错了我还不知道嘛== 链接模板大法好==#include #include usingnamespacestd; constintMAXN=1000100; structDS { intf[MAXN]; voidinit(intn) { for(inti=0;i>n>>m) ///n:人数m:操作数 { if(m==0&&n==0)break; soul.init(n); wh
zhou_yujia
·
2015-08-10 09:00
poj
并查集
Poj 1611 The
Suspects
Poj1611的传送门***TheSuspects*** DescriptionSevereacuterespiratorysyndrome(SARS),anatypicalpneumoniaofunknownaetiology,wasrecognizedasaglobalthreatinmid-March2003.Tominimizetransmissiontoothers,thebeststr
qingshui23
·
2015-08-09 11:00
并查集
Poj 1611 The
Suspects
TheSuspectsTimeLimit: 1000MS MemoryLimit: 20000KTotalSubmissions: 27102 Accepted: 13230DescriptionSevereacuterespiratorysyndrome(SARS),anatypicalpneumoniaofunknownaetiology,wasrecognizedasaglobalthrea
Grit_ICPC
·
2015-08-06 10:00
poj
并查集
POJ 1611--The
Suspects
【并查集水题】
TheSuspectsTimeLimit: 1000MS MemoryLimit: 20000KTotalSubmissions: 26908 Accepted: 13149DescriptionSevereacuterespiratorysyndrome(SARS),anatypicalpneumoniaofunknownaetiology,wasrecognizedasaglobalthrea
hpuhjh
·
2015-08-01 17:00
POJ - 1611The
Suspects
-并查集
POJ-1611TheSuspectsTimeLimit: 1000MS MemoryLimit: 20000KB 64bitIOFormat: %I64d&%I64uSubmit StatusDescription严重急性呼吸系统综合症( SARS), 一种原因不明的非典型性肺炎,从2003年3月中旬开始被认为是全球威胁。为了减少传播给别人的机会, 最好的策略是隔离可能的患者。在Not-Spre
qq_18661257
·
2015-07-31 18:00
The
Suspects
(POJ_1611)
DescriptionSevereacuterespiratorysyndrome(SARS),anatypicalpneumoniaofunknownaetiology,wasrecognizedasaglobalthreatinmid-March2003.Tominimizetransmissiontoothers,thebeststrategyistoseparatethesuspectsf
highmath_Final
·
2015-07-29 08:00
简单并查集之按秩合并——The
Suspects
DescriptionSevereacuterespiratorysyndrome(SARS),anatypicalpneumoniaofunknownaetiology,wasrecognizedasaglobalthreatinmid-March2003.Tominimizetransmissiontoothers,thebeststrategyistoseparatethesuspectsf
FengTwoYear
·
2015-07-27 08:00
POJ - 1611 - The
Suspects
(并查集)
TheSuspectsTimeLimit:1000MS MemoryLimit:20000KTotalSubmissions:26579 Accepted:12991DescriptionSevereacuterespiratorysyndrome(SARS),anatypicalpneumoniaofunknownaetiology,wasrecognizedasaglo
violet_echo_0908
·
2015-07-25 14:00
poj
并查集
ZOJ_1789The
Suspects
//这是一道并查集的题,很简单,不多说//AC代码:#include #definemax30005 intp[max]; intnum[max]; intfind(intk) { if(p[k]!=k) { p[k]=find(p[k]); } returnp[k]; } intbing(intx,inty) { intx1=find(x); inty1=find(y); if(x1==y1)
zyx520ytt
·
2015-07-24 13:00
B - The
Suspects
-poj 1611
病毒扩散问题,SARS病毒最初感染了一个人就是0号可疑体,现在有N个学生,和M个团队,只要团队里面有一个是可疑体,那么整个团队都是可疑体,问最终有多少个人需要隔离... 再简单不过的并查集,只需要不断的合并每一行就行可,到最后查询一个所有与0相同的树根就行了 //////////////////////////////////////////////////////////
·
2015-07-22 15:00
poj
POJ 1611 The
Suspects
(并查集)
TheSuspectsTimeLimit: 1000MS MemoryLimit: 20000KTotalSubmissions: 24633 Accepted: 12072DescriptionSevereacuterespiratorysyndrome(SARS),anatypicalpneumoniaofunknownaetiology,wasrecognizedasaglobalthrea
u013068502
·
2015-04-14 22:00
poj
poj1611(感染病患者)
The
Suspects
Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 24587
·
2015-04-10 11:00
poj
UVALive 4126 (LA 4126) Password
Suspects
AC自动机 + DP + 剪枝dfs
题目大意:白书练习题就是给了M(0 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include usingnamespacestd; c
u013738743
·
2015-02-13 21:00
password
uvalive
AC自动机
la
Suspects
DFS剪枝
4126
4126
POJ1611 The
Suspects
并查集
题目大意:有n个学生,分成m组,SARA病毒感染编号为0的学生,某一组学生要被隔离,当且仅当该组里有至少一个人感染SARA病毒,现在问你一共需要隔离多少学生。典型的并查集问题,找出编号为0的学生所在的集合有多少元素即可。#include #include usingnamespacestd; #defineMAX30010 intpar[MAX],rank[MAX]; voidInit(
AC_Gibson
·
2014-12-31 11:00
POJ-1611-The
Suspects
(简单并查集!)
TheSuspectsTimeLimit: 1000MS MemoryLimit: 20000KTotalSubmissions: 23337 Accepted: 11345DescriptionSevereacuterespiratorysyndrome(SARS),anatypicalpneumoniaofunknownaetiology,wasrecognizedasaglobalthrea
u014355480
·
2014-11-21 09:00
C++
C语言
ACM
iostream
并查集
poj 1611-The
Suspects
(并查集)
题目大意:SARS(非典型肺炎)传播得非常厉害,其中最有效的办法是隔离那些患病、和患病者接触的人。现在有几个学习小组,每小组有几个学生,一个学生可能会参加多个小组。小组中只要有一个人得病,其余的都是嫌疑人。现在已知这些小组的人员,且0号学生已经患病,求一共有多少个嫌疑人。解析:并查集的水题,套并查集的模板,并计算出与0号,所在同一个集合的有多少人就好了。#include #include #inc
HelloWorld10086
·
2014-11-14 11:00
poj
the
Suspects
1611
POJ - 1611The
Suspects
一道简单的并查集,其实每一种新的东西去学之前你把它的原理搞懂了才能引申,不然只会停留在最初的层次。#include #include #include usingnamespacestd; typedefstruct { intpre; intnum; }Tree; Treetree[30000]; intfind(intx) { if(tree[x].pre==x) { returnx;
Mosu_
·
2014-11-04 20:00
上一页
1
2
3
4
5
下一页
按字母分类:
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
其他