Posted: Wed Dec 21, 2005 3:26 pm
Ah! I'm correct. Got it accepted now. Was printing an extra '%', it seems.
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
9th input has no 10 elements, so I added '10' in the tail.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
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
Code: Select all
7
1 2 2 3 4 5 7
Code: Select all
2 3 1
Code: Select all
3 1 1
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?I'm passing all the samples posted here.
- 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.