How Many Did We Catch?
The same screening model, a different reader. Harborline's compliance officer answers to the regulator for every banned item that leaves the depot, and a parcel nobody opened is a parcel nobody can defend. She is not interested in how many clean boxes went to the bench by mistake. She wants to know what got past.
Task: Print the share of the genuinely dangerous parcels that the model flagged.
Input
The first line holds an integer n, the number of parcels. Each of the next n lines holds two values separated by a single space: the true label first, the model's label second. Both are 1 (banned item inside) or 0 (clean). At least one parcel really was dangerous, so the answer always exists.
Output
One line: a number between 0 and 1 with exactly two digits after the decimal point. Print 1.00, not 1, when nothing got through.
Example:
Input:
5
1 1
1 0
1 1
0 0
1 0
Output:
0.50
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