Given a submission log, ignore the administrator, count solvers and the rejections each made before their first accepted submission, then print the accepted ratio with 10 decimals.
Easy3ImplementationHash mapMathSimulationNo attempts yetTime limit2sMemory limit512 MBAn online judge computes the accepted ratio of each problem with this formula.
A+WA×100
A is the number of people who solved the problem, and W is the total number of rejected submissions those people sent before their own first accepted submission. A submission counts as rejected when its verdict is anything other than accepted. Submissions from the administrator account are dropped from the whole calculation. If nobody outside the administrator solved the problem, the denominator is 0 and the accepted ratio is 0.
The submission log of one problem is given. Write a program that computes its accepted ratio.
The first line contains the total number of submissions N (1≤N≤200000).
Each of the next N lines holds one submission, in increasing order of judge number. A line has seven values separated by single spaces, in this order.
_). Ids that differ in letter case belong to different people. The id megalusion is the administrator.Print the accepted ratio on the first line with exactly 10 digits after the decimal point. Round at the eleventh digit after the point, and round up when the value sits exactly halfway between two results. The count of digits after the point is always 10, so a ratio of exactly 50 prints as 50.0000000000.
Integer arithmetic gives the exact value: divide A×100×1010 by A+W and round the quotient.