Peg Test - March 9

Question 1

Bobette was walking home one day, when she slipped on a banana peel. Of course, the papers that she was carrying flew everywhere. They were actually the test scores for her PEG students, arranged from highest to lowest, so that she would be able to find the median easily. Help Bobette calculate the median on the test (to one decimal place), given T ( 0 < T ≤ 10), the number of students who wrote the test, followed by N lines, which list their percentage scores.

Input

Input starts with T, followed by the scores for T tests on separate lines.

Output

Output the median score on the tests.

Sample Input

4
79
95
24
78

Sample Output

The median on the test is 78.5

All Submissions
Best Solutions


Point Value: 5
Time Limit: 2.00s
Memory Limit: 16M
Added: Mar 08, 2011

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

I tested my program with numerous values and the median is outputted correctly with one decimal place. Why is my program being deemed incorrect by the judge? Can someone assist me with this issue? Thank you.


I don't know why I'm getting invalid returns

When you call input(), that returns a string. You need to convert that to a number manually.

There is a much better solution. a = int(input("Text"))

Can someone please tell me what my error is?!?!?!

Unfortunately the statistics module was introduced in version 3.4, so it's not supported by the judge.

I'm not sure what's wrong with my code.

Your output isn't formatted correctly.

Exactly as the name states.

One decimal place only. If you add anymore, the judge marks it as incorrect.

Seriously? Okay, Thanks

Now what am I doing wrong?

all output must be formatted to one decimal place

Pretty sure i did that, though

setprecision rounds off, so it does not necessarily have to show one decimal place if the first decimal is 0. Use printf instead.