Using a Sequential Colormap
Instead of one flat colour, Pike Street Studio shades each bar according to its own reading, so the tallest bar also comes out the most intense. The shading repeats what the height already says, and that is deliberate: a reader glancing rather than studying picks up the colour first, and the redundancy still works when the chart is printed small. Because a shade is hard to rank precisely by eye, the caption names the bar that ends up most intense.
Task: Print the position of the bar with the largest reading. Positions are counted from 0, so the first bar is position 0. If two or more bars share the largest reading, print the position of the earliest of them.
Input
The first line holds an integer n, the number of bars. Each of the next n lines holds one reading, possibly with decimals. n is at least 2, and the readings are never all identical.
Output
One line holding a whole number: the bar's position.
Example:
Input:
3
10
50
30
Output:
1
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in