Editorial for COCI '16 Contest 6 #1 H-indeks


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

When determining the h-index, it is obvious that we need to observe the papers with more citations. Therefore, we first sort the numbers by size, starting with the largest. We iterate over this array respectively (index K = 1, 2, 3, \dots) and if the K^\text{th} element is larger than or equal to K, this means that K is a potential h-index (because the scientist has at least K papers with a citation score larger than or equal to K). The task comes down to finding the largest such K, which is easily solved by storing the solution in an auxiliary variable and updating it while iterating the array.


Comments

There are no comments at the moment.