Awesome
codejam-templates
Templates for Google Code Jam contests in different programming languages.
In order to make a good demonstration of language constructs the following simple problem is solved by the templates.
Problem statement
Answer median and arithmetic mean calculation queries for given arrays of real numbers. For median queries arrays will have odd length. For each query answer must have 10 correctly rounded fractional digits.
Example of input:
<pre> 2 median 3 2.32 1.55 3.17 mean 2 5 7 </pre>Example of output:
<pre> Case #1: 2.3200000000 Case #2: 6.0000000000 </pre>-- Feel free to contribute additional languages and corrections.
Todo: add multi-threaded templates.