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 »

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 »

Nevermind.

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

Re: 11546 Olympic Swimming

Post by mmonish »

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 »

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 »

>>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 »

Can anyone explain the algorithm to this problem?

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 »

Hashing is one of the approaches for this problem.

Post Reply

Return to “Volume 115 (11500-11599)”