11546 - Olympic Swimming

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

Moderator: Board moderators

Post Reply
mmonish
Experienced poster
Posts: 109
Joined: Sun Mar 11, 2007 2:55 pm
Location: SUST

11546 - Olympic Swimming

Post by mmonish » Sun Oct 26, 2008 3:28 pm

I have been trying this prob but getiing WA many times.anyone please check my code and tell me what is wrong here..
here is my code..
removed...
Last edited by mmonish on Tue Oct 28, 2008 11:59 am, edited 1 time in total.

baodog
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am

Re: 11546 Olympic Swimming

Post by baodog » Sun Oct 26, 2008 10:42 pm

Nevermind.

mmonish
Experienced poster
Posts: 109
Joined: Sun Mar 11, 2007 2:55 pm
Location: SUST

Re: 11546 Olympic Swimming

Post by mmonish » Mon Oct 27, 2008 4:39 pm

still i am getting WA.anyone please check the following I/O..

Code: Select all

15 3
5 0 7 9 11 12
4 2 6 8 12
5 4 5 8 9 12
20 5
2 0 19
3 0 18 19
2 15 16
3 14 15 19
3 18 19 2
50000 30
5 4 8 6 7 9999
4 1 5 8 6
3 1 2 3
4 1 5 8 6
3 1 2 3
4 1 5 8 6
3 1 2 3
4 1 5 8 6
3 1 2 3
4 1 5 8 6
3 1 2 3
4 1 5 8 6
3 1 2 3
4 1 5 8 6
3 1 2 3
4 1 5 8 6
3 1 2 3
4 1 5 8 6
3 1 2 3
4 1 5 8 6
3 1 2 3
4 1 5 8 6
3 1 2 3
4 1 5 8 6
3 1 2 3
4 1 5 8 6
3 1 2 3
4 1 5 8 6
3 1 2 3
5 1 2 3 4 5
12 4
8 0 1 2 3 4 5 6 7
7 0 1 2 3 4 5 6
4 0 5 9 11
3 9 10 11
1 5
1 0
1 0
1 0
1 0
0
0 0
My Output:

Code: Select all

Case #1: 8 meter(s)
Case #2: 11 meter(s)
Case #3: 40000 meter(s)
Case #4: 9 meter(s)
Case #5: 0 meter(s)

Vytenis
New poster
Posts: 7
Joined: Mon Aug 04, 2008 8:16 pm

Re: 11546 Olympic Swimming

Post by Vytenis » Mon Oct 27, 2008 5:54 pm

My AC solution gives:

Code: Select all

Case #1: 8 meter(s)
Case #2: 11 meter(s)
Case #3: 40000 meter(s)
Case #4: 1 meter(s)
Case #5: 0 meter(s)

mmonish
Experienced poster
Posts: 109
Joined: Sun Mar 11, 2007 2:55 pm
Location: SUST

Re: 11546 Olympic Swimming

Post by mmonish » Tue Oct 28, 2008 11:59 am

>>Vytenis
thx for ur reply. I found my mistake. i will try it another way..

SerailHydra
New poster
Posts: 20
Joined: Mon Oct 20, 2008 6:26 am

Re: 11546 Olympic Swimming

Post by SerailHydra » Wed Nov 05, 2008 8:09 am

Can anyone explain the algorithm to this problem?

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

Re: 11546 Olympic Swimming

Post by emotional blind » Sun Nov 16, 2008 12:33 pm

Hashing is one of the approaches for this problem.

Post Reply

Return to “Volume 115 (11500-11599)”