锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产精品综合久久网络,精品综合久久久久久97,免费一级欧美大片久久网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 鍙戣〃璇勮
]]>
日本久久久久久中文字幕| 久久久久无码国产精品不卡| 久久久久久伊人高潮影院| 久久人与动人物a级毛片| 久久香综合精品久久伊人| 久久99精品久久久久久水蜜桃| 日本久久中文字幕| 国产精品久久久久无码av| 亚洲精品国产自在久久| 99久久精品日本一区二区免费| 狠狠精品干练久久久无码中文字幕| 久久九九久精品国产免费直播| 91麻精品国产91久久久久| 久久大香香蕉国产| 亚洲色欲久久久综合网| 国产午夜精品久久久久九九| 久久国产精品77777| 亚洲精品美女久久777777| 亚洲精品国产综合久久一线| 久久精品无码一区二区三区免费| 久久这里只有精品18| 久久综合给合久久国产免费| 天天做夜夜做久久做狠狠| 国产精品美女久久久免费| 亚洲国产二区三区久久| 久久精品无码午夜福利理论片| 久久亚洲精品国产亚洲老地址 | 综合久久精品色| 久久精品夜色噜噜亚洲A∨| AV无码久久久久不卡蜜桃| 婷婷伊人久久大香线蕉AV | 日韩人妻无码一区二区三区久久| 久久久久亚洲AV综合波多野结衣| 国产综合精品久久亚洲| 94久久国产乱子伦精品免费| 久久久久久久尹人综合网亚洲| 精品久久无码中文字幕| 狠狠色丁香婷婷综合久久来| 精品免费tv久久久久久久| 久久精品免费观看| 久久AⅤ人妻少妇嫩草影院|