Not-Afraid's blog

By Not-Afraid, history, 4 years ago, In English

My initial solution was if there exists a subarray with size > 1 and median k than answer is yes.
But, afer getting a lot of WA on pretest 10, at the last moment i realized that the solution is yes if there exists any subarray of size > 1 with median >= k and i didn't have time so i just submitted my solutin which uses 6 iterations to check if there exists a subarray with size atleast two and median >= k. It passed pretests + system testing.

tc for which my solution fails
  • Vote: I like it
  • +27
  • Vote: I do not like it

»
4 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Try to reach Div.1 , then you will have the right to uphack(hack anyone after the contest, including yourself)

(And I got away from div.1 just now :(

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Will that counts in the final standing ??

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It's alright. You atleast reached there(Div 1).

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Thanks for your encouragement. I know failure is required to become successful.

      (Also this round taught me: Never trust pow() function

      • »
        »
        »
        »
        4 years ago, # ^ |
          Vote: I like it +4 Vote: I do not like it

        Not only pow but sqrt, cbrt, sqrtl, cbrtl i have been fu**ed by all of these at some point of time.