PEG 11/12 Programming Test 1 - October 19
Problem 3: Cyclopian Cash
Alas, FurWear has failed to turn a profit from the mysterious land of Cyclopia. Upon realising that giants can wear clothing in larger sizes but not in smaller sizes, FurWear has decided to produce clothing sized according to the median of all the sizes, so as to fit approximately half the population. (Having clothing that fits the entire population would hardly make FurWear exclusive!)
Write a program to correct this silly oversight.
Input
The first line consists of a single integer N (1 ≤ N ≤ 1000), the number of Oelfinn. The following N lines each contain a single integer ai (10 ≤ ai ≤ 1000), the size of clothing worn by the ith Oelfinn.
Output
Output on a single line the median of all the sizes, to one decimal place.
Sample Input
6 28 49 18 40 69 37
Sample Output
38.5
All Submissions
Best Solutions
Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 17, 2011
Author: jargon
Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3
Comments (Search)
can someone just check my code over?
Thanks in advance :-)
In general, it's a good idea to take a very thorough look at the problem statement.
my submission works in python 3.4 but I believe the PEG Judge is on version 3.2.3
I think An Admin should update the PEG judge