10331 - The Flyover Construction

All about problems in Volume 103. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

User avatar
babor
New poster
Posts: 16
Joined: Sat Jun 07, 2003 4:23 pm
Contact:

10331- Wa

Post by babor » Wed Dec 17, 2003 5:46 pm

Hai everybody,
I got wa at 10331 Flyover construction.
Any hints or advice to avoid this .
Thanks in advance
babor

erfan
New poster
Posts: 44
Joined: Tue Apr 15, 2003 4:31 pm
Location: Chittagong,Bangladesh
Contact:

Post by erfan » Thu Jan 01, 2004 7:39 am

Hello all greathelper,
I also got WA in this problem.
I solve it by shortest path (again and again.)
Please give me such critical I/O to test my code.

Thanks in advance.

rhsumon
New poster
Posts: 48
Joined: Wed Aug 23, 2006 12:29 pm
Location: Dhaka

Re: I am having real trouble with 10331 the Flyover construction

Post by rhsumon » Tue Apr 01, 2008 5:38 pm

Presentation Error:::::::: Why PE
My output code is like,

Code: Select all

		for(i=1; i<=m; i++){
			if(count[i]==max){
				printf("%d",i);
				if(i<m) printf(" "); 
			}
		}
		printf("\n");
Is there any problem .............
plz give some adv.

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Re: I am having real trouble with 10331 the Flyover construction

Post by Jan » Tue Apr 01, 2008 9:19 pm

rhsumon wrote:Presentation Error:::::::: Why PE
My output code is like,

Code: Select all

		for(i=1; i<=m; i++){
			if(count[i]==max){
				printf("%d",i);
				if(i<m) printf(" "); 
			}
		}
		printf("\n");
Is there any problem .............
plz give some adv.
Of course, there is. Just think that count[m-1] = max and count [m] < max.... Then a trailing space will be printed. Am I right? You can solve this problem easily...

Code: Select all

		int flag=0;
		for(i=1; i<=m; i++){
			if(count[i]==max){
				if(flag++) printf(" "); 
				printf("%d",i);
			}
		}
		printf("\n");
Hope it helps.
Ami ekhono shopno dekhi...
HomePage

rhsumon
New poster
Posts: 48
Joined: Wed Aug 23, 2006 12:29 pm
Location: Dhaka

Re: I am having real trouble with 10331 the Flyover construction

Post by rhsumon » Wed Apr 02, 2008 7:58 pm

Thnkx but some problem........
But is that false.......... if i reform my code like that..

Code: Select all

Actually i've understood..........
What a stupid am i!!!!!!!!!!!!!!!!!!!!!!!!! :x 
Is there also print any trailing " "? I'm confused.............
Ok u r correct but i am confusing abt that

Post Reply

Return to “Volume 103 (10300-10399)”