Codeforcer's blog

By Codeforcer, history, 4 years ago, In English

I wanted to do a runtime analysis of B. It got AC even though I doubted it as it looked worst case O(n^2). Basically I just simulated what was asked. It is also mentioned in the editorial that simulation would take too much time. I am now really interested in the runtime of my code.

ARC-105_B

Also any ideas on D?

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
Rev. 3   Vote: I like it -10 Vote: I do not like it

Edit: For this test case: 1 2 10e9 your code will run $$$10^9$$$ loops. The test cases were so weak. In those test cases there was not any test case where $$$max\space element - min\space element > 10^5$$$ (or something more) appeared.

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

    I dont think so..as the size of the hashset remains constant for quite a time before reducing by 1. Also it doesnt explain the statement in the editorial.

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

      Ok. Try this test case: 1 2 10000000. It executes in around $$$2$$$ seconds for your code. May be the test cases were weak. My solution is also like you which will give TLE in some cases.

      My code