Follows 105.c (Total 47 lines):

/* @JUDGE_ID:4461XX 105 C */
/* A */
#include<stdio.h>
#include<limits.h>
#define N 10000
int high[N] ;
void initial( void )
{
	int i ;
	for( i=0 ; i<N ; i++ ) high[i] = 0 ;
}
void make_high( int left , int right , int h )
{
	int i ;
	for( i=left ; i<right ; i++ )
		if( high[i] < h ) high[i] = h ;
}
void print( int max , int left_stand )
{
	int i , now_h=-1 ;
	int firstOutput=1;
	for( i=0 ; i<=max ; i++ )
		if( now_h != high[i] ){
			if( firstOutput ){
				printf( "%d %d" , i+left_stand , high[i] ) ;
				firstOutput = 0;
			}
			else
				printf( " %d %d" , i+left_stand , high[i] ) ;
			now_h = high[i] ;
		}
	putchar( '\n' );
}
void main( void )
{
	int left_stand , left , right , h , right_max=0 ;
	initial() ;
	scanf( "%d %d %d" , &left_stand , &h , &right ) ;
	make_high( 0 , right-left_stand , h ) ;
	if( right-left_stand > right_max ) right_max = right - left_stand ;
	while( scanf( "%d %d %d" , &left , &h , &right ) == 3 ){
		make_high( left-left_stand , right-left_stand , h ) ;
		if( right-left_stand > right_max ) right_max = right - left_stand ;
	}
	print( right_max , left_stand ) ;
}
/* @END_OF_SOURCE_CODE */

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