Canadian Computing Competition: 2005 Stage 1, Senior #5
Pinball is an arcade game in which an individual player controls a silver ball by means of flippers, with the objective of accumulating as many points as possible. At the end of each game, the player's score and rank are displayed. The score, an integer between
More precisely,
Input Specification
You are to implement the pinball machine's ranking algorithm. The first line of input contains a positive integer,
Output Specification
You are to output the average of the ranks up to an absolute error of
At least one test case will have
Sample Input
5
100
200
150
170
50
Sample Output
2.20
Explanation for Sample Output
The pinball screen would display (in turn):
1 of 1
1 of 2
2 of 3
2 of 4
5 of 5
The average rank is
Comments
TLE 🤬
Since the data were not language friendly, the specificity for the answer has been updated (refer to the problem statement), and all submissions were rejudged.
Can we assume no two input are the same?
If they are the same, what should I output?
Inputs are not necessarily distinct
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
Your solution is
because insertion into an ArrayList at an arbitrary position takes 
time.
Really? Okay thanks a lot!
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.