The Punishing Metric
Northwind's board is less worried about the typical day than about the day the shelves ran empty. They want the forecast error summarised so that one disastrous day outweighs a long run of small slips, and they still want it in crates so it can sit beside yesterday's figure in the same column.
Task: Print the root mean squared error of the forecasts.
Input
The first line holds an integer n, the number of days. Each of the next n lines holds two numbers separated by a single space: the true demand first, the forecast second.
Output
One line, in crates, with exactly two digits after the decimal point. Direction does not matter: a miss over and a miss under of the same size weigh the same. Print 0.00 when every forecast was exact.
Example:
Input:
3
10 12
20 18
30 36
Output:
3.83
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