C++20 sections · 1024 units
Open in Course

Next Round - The Idea

The threshold condition

The core insight: you need TWO conditions to be true. First, the score must be positive (>0> 0). Second, the score must be at least the kk-th contestant's score (>=threshold>= threshold). Many people miss the positive requirement.

Even if someone ties the kk-th place, they won't advance if that score is zero. You must check BOTH conditions using the AND operator. Store the kk-th contestant's score as your threshold.

Then iterate through all scores, counting those that pass both checks.