锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久偷看各类wc女厕嘘嘘,性欧美丰满熟妇XXXX性久久久,久久精品国产亚洲av日韩http://m.shnenglu.com/vontroy/archive/2010/07/29/121521.htmlVontroyVontroyWed, 28 Jul 2010 23:09:00 GMThttp://m.shnenglu.com/vontroy/archive/2010/07/29/121521.htmlhttp://m.shnenglu.com/vontroy/comments/121521.htmlhttp://m.shnenglu.com/vontroy/archive/2010/07/29/121521.html#Feedback0http://m.shnenglu.com/vontroy/comments/commentRss/121521.htmlhttp://m.shnenglu.com/vontroy/services/trackbacks/121521.html#include <iostream>
#include <cstdio>
const int maxn = 30000 + 5;
using namespace std;
int father[maxn],rank[maxn];
void init( int n )
{
for ( int i = 0; i < n; i++)
{
father[i] = i;
rank[i] = 1;
}
}
int findSet( int n )
{
if(father[n] != n)
father[n] = findSet(father[n]);
return father[n];
}
void Union( int a, int b )
{
int x = findSet( a );
int y = findSet( b );
if( x == y ) return ;
if( rank[x] >= rank[y] )
{
father[y] = x;
rank[x] += rank[y];
}
else
{
father[x] = y;
rank[y] += rank[x];
}
}
int main()
{
int m, n, count, temp, first;
while( ~scanf("%d%d", &n, &m ) && n )
{
init(n);
while( m-- )
{
scanf("%d%d", &count, &first );
for( int i = 1; i < count ;i ++)
{
scanf("%d", &temp);
Union( first, temp );
}
}
printf("%d\n",rank[findSet(0)]);
}
return 0;
}
]]>- HDU 1198 Farm Irrigationhttp://m.shnenglu.com/vontroy/archive/2010/07/29/121520.htmlVontroyVontroyWed, 28 Jul 2010 23:04:00 GMThttp://m.shnenglu.com/vontroy/archive/2010/07/29/121520.htmlhttp://m.shnenglu.com/vontroy/comments/121520.htmlhttp://m.shnenglu.com/vontroy/archive/2010/07/29/121520.html#Feedback0http://m.shnenglu.com/vontroy/comments/commentRss/121520.htmlhttp://m.shnenglu.com/vontroy/services/trackbacks/121520.html#include<iostream>
using namespace std;
int bin[2500];
int find(int x)
{return x==bin[x]?x:find(bin[x]);}
void merge(int x,int y)
{
x=find(x);
y=find(y);
if(x!=y) bin[x]=y;
}
int main()
{
int a[11] = {9, 3, 12, 6, 5, 10, 11, 13, 14, 7, 15}, m, n, i, j, map[50][50], total;
char c;
while(scanf("%d %d", &m, &n), m != -1 || n != -1){
getchar();
for(i = 0; i < m; ++i){
for(j = 0; j < n; ++j){
scanf("%c", &c);
map[i][j] = c - 65;
}
getchar();
}
for(i = 0; i < m * n; ++i) bin[i] = i;
for(i = 0; i < m; ++i)
for(j = 0; j < n; ++j){
if(i + 1 < m && a[map[i][j]] & 0x04 && a[map[i + 1][j]] & 0x01)
merge(i * n + j, i * n + n + j);
if(j + 1 < n && a[map[i][j]] & 0x02 && a[map[i][j + 1]] & 0x08)
merge(i * n + j, i * n + j + 1);
}
for(total = 0, i = 0; i < m * n; ++i)
if(i == bin[i]) ++total;
printf("%d\n", total);
}
return 0;
}
]]>
狠狠色婷婷久久综合频道日韩
|
久久久久亚洲Av无码专|
久久久久久国产精品免费免费|
AAA级久久久精品无码片|
久久精品国产精品国产精品污|
久久久久国产一级毛片高清版|
狠狠色丁香久久婷婷综合蜜芽五月
|
日产精品99久久久久久|
久久99精品免费一区二区|
久久WWW免费人成一看片|
国产精品午夜久久|
久久精品国产精品亚洲毛片|
99久久精品影院老鸭窝|
无码人妻久久一区二区三区
|
久久久久久久综合综合狠狠|
久久中文字幕精品|
久久综合五月丁香久久激情|
国产激情久久久久影院小草|
国产亚洲精品久久久久秋霞|
一本大道久久a久久精品综合|
久久99精品国产|
亚洲欧洲日产国码无码久久99|
99久久精品费精品国产
|
成人综合伊人五月婷久久|
欧美激情精品久久久久久|
777久久精品一区二区三区无码|
99久久精品免费看国产一区二区三区|
国产成人香蕉久久久久|
97久久超碰成人精品网站|
蜜臀av性久久久久蜜臀aⅴ麻豆|
久久亚洲国产精品成人AV秋霞|
国内精品久久久久影院网站|
国产精品视频久久久|
久久天天躁狠狠躁夜夜网站|
精品久久久久久久久免费影院|
欧美久久天天综合香蕉伊|
伊人久久亚洲综合影院|
久久香蕉国产线看观看猫咪?v|
亚洲国产精品热久久|
97久久精品人人做人人爽|
国产精品成人99久久久久|