11067 - Little Red Riding Hood

All about problems in Volume 110. 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
Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)

Re: 11067 getting repeated WA help pls

Post by Martin Macko » Mon Aug 14, 2006 12:03 am

ayeshapakhi wrote:i would be very greatful to u if u help me fixing bug.....
i'm getting fed up with continous WA....
Exchangeing h and w in the following part of your code should help:
ayeshapakhi's main() wrote:......for(i=0; i<=w; i++)......<-- replace with h
......{
.........for(j=0; j<=h; j++)......<-- replace with w
.........{
..............
.........}
......}

temper_3243
Experienced poster
Posts: 105
Joined: Wed May 25, 2005 7:23 am

Post by temper_3243 » Mon Aug 14, 2006 7:08 pm

Please post test cases where this breaks. I have tried with everything i know but it gives WA.

Code: Select all

code removed after accepted
Last edited by temper_3243 on Fri Aug 18, 2006 4:48 pm, edited 1 time in total.

User avatar
Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)

Post by Martin Macko » Mon Aug 14, 2006 8:03 pm

temper_3243 wrote:Please post test cases where this breaks. I have tried with everything i know but it gives WA.
Once again the same mistake we have already discussed here twice. Have you read the thread before posting your code?

temper_3243
Experienced poster
Posts: 105
Joined: Wed May 25, 2005 7:23 am

Post by temper_3243 » Mon Aug 14, 2006 8:57 pm

thanks i just swapped and it got accepted. I misread grandmothers house at (h,w) instead of (w,h) .

ayeshapakhi
Learning poster
Posts: 60
Joined: Sun Apr 16, 2006 7:59 pm

many many thanks......

Post by ayeshapakhi » Tue Aug 15, 2006 6:35 am

dear Martin....... u are great!
thanks from my heart..........
i swapped the variables and at last got AC...
thanks thanks thanks and thanks...........
:D :D :D

User avatar
Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)

Post by Martin Macko » Tue Aug 15, 2006 10:33 am

temper_3243 wrote:thanks i just swapped and it got accepted. I misread grandmothers house at (h,w) instead of (w,h) .
After getting AC, please, remove the code from your previous post.

asmaamagdi
New poster
Posts: 27
Joined: Tue Dec 20, 2005 9:14 am
Location: Egypt

Post by asmaamagdi » Sun Mar 09, 2008 4:20 am

What's wrong with this:

Code: Select all

AC
it gave me WA
Last edited by asmaamagdi on Sun Mar 09, 2008 10:04 am, edited 1 time in total.
---
Asmaa Magdi

User avatar
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind » Sun Mar 09, 2008 8:02 am

add this condition

Code: Select all

if(x>w || y>h)return 0;

asmaamagdi
New poster
Posts: 27
Joined: Tue Dec 20, 2005 9:14 am
Location: Egypt

Post by asmaamagdi » Sun Mar 09, 2008 10:03 am

yup right. stupid mistake :oops:
Thnx very much, got it Aced now :D
---
Asmaa Magdi

Post Reply

Return to “Volume 110 (11000-11099)”