10057 - A mid-summer night's dream.

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

Moderator: Board moderators

mamun
A great helper
Posts: 286
Joined: Mon Oct 03, 2005 1:54 pm
Location: Bangladesh
Contact:

Post by mamun » Wed Dec 21, 2005 3:26 pm

Ah! I'm correct. Got it accepted now. Was printing an extra '%', it seems.

User avatar
A1
Experienced poster
Posts: 173
Joined: Wed Jan 28, 2004 3:34 pm
Location: Bangladesh

Post by A1 » Tue Sep 05, 2006 5:38 am

can any body give the correct output for these inputs:

Code: Select all

2
1 1
4
1 1 1 2
5
2 2 2 2 6
9
1 2 5 5 5 6 6 7 8
16
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 65000
17
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 65000
16
1 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000
17
1 1 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000
10
1 2 3 4 5 6 7 8 9
21
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6
thanks in advance :)

tan_Yui
Experienced poster
Posts: 155
Joined: Sat Jul 10, 2004 12:41 am

Post by tan_Yui » Tue Sep 05, 2006 8:36 am

2
1 1
4
1 1 1 2
5
2 2 2 2 6
9
1 2 5 5 5 6 6 7 8
16
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 65000
17
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 65000
16
1 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000
17
1 1 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000 65000
10
1 2 3 4 5 6 7 8 9 10
21
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6
9th input has no 10 elements, so I added '10' in the tail.
My code outputs :

Code: Select all

1 2 1
1 3 1
2 4 1
5 3 1
1 15 1
1 16 1
65000 15 1
65000 15 1
5 2 2
5 5 1
Best regards.

User avatar
kbr_iut
Experienced poster
Posts: 103
Joined: Tue Mar 25, 2008 11:00 pm
Location: IUT-OIC, DHAKA, BANGLADESH
Contact:

10057 - A Mid-summer Night’s Dream WA

Post by kbr_iut » Tue Jun 24, 2008 10:49 pm

thanx "Bluefin". I got AC now.
actually I misunderstood the problem at somewhere.....I recoded and got AC.
Last edited by kbr_iut on Wed Sep 10, 2008 9:43 am, edited 1 time in total.
It is tough to become a good programmer.
It is more tough to become a good person.
I am trying both...............................

Bluefin
New poster
Posts: 20
Joined: Sat Jul 08, 2006 3:39 pm
Contact:

Re: 10057 - A Mid-summer Night’s Dream

Post by Bluefin » Sat Aug 09, 2008 7:39 am

Hello, kbr_iut:

I solved this problem this morning. I think your program failed on the following case

Code: Select all

7
1 2 2 3 4 5 7
your program prints

Code: Select all

2 3 1
while my AC program returns

Code: Select all

3 1 1
Hope this case will help you debug. :D
"It's nice to be important, but it's more important to be nice"

http://bluefintuna.wordpress.com/

mnafshin
New poster
Posts: 4
Joined: Sat Sep 25, 2010 4:14 pm

Re:

Post by mnafshin » Sat Sep 25, 2010 4:23 pm

mamun wrote:Problem descripiton was really confusing to me. Thanks to tan_Yui for explaining it. But I am still getting WA. Can somebody say if I am correct with my understanding?
  • 1st number to output is the median
    2nd number to output is the frequency of median(s) in the input
    3rd number to output is 1 if n is odd, median2 - median1 + 1 otherwise.
I'm passing all the samples posted here.

i think you are in wrong with 2nd output
for example out put for
6
1
2
2
4
4
5
is
2 4 3

the second output is number of A that there are in input
for previous example A can be 2 or 3 or 4
for first output minimum is 2
for second output there are two 2 and two 4 and zero 3 in the input then two + two + zero = 4
for the last output A can get 3 number(2,3,4) then output is 3

User avatar
uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

Re: 10057 - A Mid-summer Night’s Dream

Post by uDebug » Tue Jul 01, 2014 8:41 am

Thanks to all for all the great test cases and discussions. This really helped out a bunch.
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

Post Reply

Return to “Volume 100 (10000-10099)”