锘??xml version="1.0" encoding="utf-8" standalone="yes"?>77777亚洲午夜久久多人,久久亚洲精品无码播放,久久久久久久综合日本亚洲http://www.shnenglu.com/vontroy/archive/2010/07/29/121521.htmlVontroyVontroyWed, 28 Jul 2010 23:09:00 GMThttp://www.shnenglu.com/vontroy/archive/2010/07/29/121521.htmlhttp://www.shnenglu.com/vontroy/comments/121521.htmlhttp://www.shnenglu.com/vontroy/archive/2010/07/29/121521.html#Feedback0http://www.shnenglu.com/vontroy/comments/commentRss/121521.htmlhttp://www.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 );
            
forint i = 1; i < count ;i ++)
            {
                scanf(
"%d"&temp);
                Union( first, temp );
            }
        }
        printf(
"%d\n",rank[findSet(0)]);
    }
    
return 0;
}


Vontroy 2010-07-29 07:09 鍙戣〃璇勮
]]>
HDU 1198 Farm Irrigationhttp://www.shnenglu.com/vontroy/archive/2010/07/29/121520.htmlVontroyVontroyWed, 28 Jul 2010 23:04:00 GMThttp://www.shnenglu.com/vontroy/archive/2010/07/29/121520.htmlhttp://www.shnenglu.com/vontroy/comments/121520.htmlhttp://www.shnenglu.com/vontroy/archive/2010/07/29/121520.html#Feedback0http://www.shnenglu.com/vontroy/comments/commentRss/121520.htmlhttp://www.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= {93126510111314715}, 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;
}


Vontroy 2010-07-29 07:04 鍙戣〃璇勮
]]>
久久中文精品无码中文字幕| 久久久久99精品成人片欧美| 国产亚洲色婷婷久久99精品91| 国产毛片久久久久久国产毛片| 久久亚洲国产精品123区| 久久AV高潮AV无码AV| 996久久国产精品线观看| 久久国产热这里只有精品| 伊人久久大香线蕉亚洲五月天| 久久久久久久久无码精品亚洲日韩 | 免费国产99久久久香蕉| 日本国产精品久久| 国产精品一久久香蕉产线看| 久久综合伊人77777麻豆| av午夜福利一片免费看久久| 一本色道久久88综合日韩精品 | 国产激情久久久久影院小草 | 久久亚洲高清观看| 四虎国产精品成人免费久久| 狠狠色综合网站久久久久久久| 亚洲国产另类久久久精品| 久久综合成人网| 国产精品无码久久久久| 丁香狠狠色婷婷久久综合| 久久精品国产久精国产果冻传媒 | 久久久久久噜噜精品免费直播| 韩国免费A级毛片久久| 中文精品久久久久人妻不卡| 久久强奷乱码老熟女| 国产精品综合久久第一页| 久久久久久综合一区中文字幕| 久久久久无码精品国产不卡| 伊人久久大香线蕉亚洲五月天| 亚洲国产成人精品91久久久| 久久狠狠一本精品综合网| 99久久综合狠狠综合久久| 99久久这里只有精品| 亚洲国产精品久久| 99久久www免费人成精品| 国产精品无码久久久久| 久久亚洲国产成人影院网站|