Блог пользователя asim2005

Автор asim2005, 4 года назад, По-английски

https://codeforces.me/problemset/problem/412/B

I couldn't understand the logic behind the first tutorial (**not** the bruteforce one). Can anyone help me?

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

»
4 года назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

Consider the array sorted in decreasing order, and it's $$$k^{th}$$$ element speed as $$$x$$$.

As it clearly produces $$$k$$$ indices $$$[0,k-1]$$$ which have speed greater than or equal to answer. there is no reason to consider any value lower than this.

Following, If we increase the speed further, The computer at $$$k^{th}$$$ position will not be able to operate and hence total number of computers will be fall less then $$$k$$$.

Hence, $$$x$$$ is the optimal choice.