Page 2 of 2

Posted: Wed Dec 21, 2005 3:26 pm
by mamun
Ah! I'm correct. Got it accepted now. Was printing an extra '%', it seems.

Posted: Tue Sep 05, 2006 5:38 am
by A1
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 :)

Posted: Tue Sep 05, 2006 8:36 am
by tan_Yui
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.

10057 - A Mid-summer Night’s Dream WA

Posted: Tue Jun 24, 2008 10:49 pm
by kbr_iut
thanx "Bluefin". I got AC now.
actually I misunderstood the problem at somewhere.....I recoded and got AC.

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

Posted: Sat Aug 09, 2008 7:39 am
by Bluefin
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

Re:

Posted: Sat Sep 25, 2010 4:23 pm
by mnafshin
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

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

Posted: Tue Jul 01, 2014 8:41 am
by uDebug
Thanks to all for all the great test cases and discussions. This really helped out a bunch.