Follows 193.c (Total 53 lines):

/* @JUDGE_ID:4461XX 193 C */
/* A */
#include<stdio.h>
char map[100][100] , ans[100] ;
int print[100] , point , max , level ;
int CanDraw( int which )
{
        int i ;
        for( i=0 ; i<point ; i++ )
                if( map[which][i] && ans[i] ) return 0 ;
        return 1 ;
}
void dfs( int begin )
{
        int i , j , k ;
        for( i=begin ; i<point ; i++ )
                if( CanDraw( i ) ){
                        ans[i] = 1 ; /* draw( i ) */
                        level++ ;
                        if( level > max ){
                                max = level ;
                                for( k=j=0 ; k<point ; k++ )
                                        if( ans[k] ) print[j++] = k ;
                        }
                        dfs( i+1 ) ;
                        ans[i] = 0 ; /* undraw( i ) */
                        level-- ;
                }
}
void main( void )
{
        int map_num , connected , i , j ;
        scanf( "%d" , &map_num ) ;
        for( ; map_num ; map_num-- , putchar( '\n' ) ){
                scanf( "%d %d" , &point , &connected ) ;
                for( i=0 ; i<point ; i++ ) ans[i] = 0 ;
                for( i=0 ; i<point ; i++ )
                        for( j=0 ; j<point ; j++ ) map[i][j] = 0 ;
                for( ; connected ; connected-- ){
                        scanf( "%d %d" , &i , &j ) ;
                        map[j-1][i-1] = map[i-1][j-1] = 1 ;
                }
                level = max = 0 ;
                dfs( 0 ) ;
                printf( "%d\n" , max ) ;
                for( i=0 ; i<max ; i++ ){
					if( i==0 )
						printf( "%d", print[i]+1 );
					else
						printf( " %d" , print[i]+1 ) ;
				}
        }
}

Back to statistics
Ya-Lin Huang (C)
huangyl@gmail.com