RakibJoy's blog

By RakibJoy, history, 22 months ago, In English

Please look at my two submissions.

204540477 204540870

My question is why I am getting TLE in my second submission?

The only difference between these submissions is given in the picture.

As far as I know, the complexity of the upper bound doesn't depend on the value.

Please Help.

Thanks in advance.

  • Vote: I like it
  • +6
  • Vote: I do not like it

»
22 months ago, # |
  Vote: I like it +8 Vote: I do not like it

This rather seems like an RTE. Your pw array is sized 26 and bs = 25, hence j + 2 can be max 26 which is out of bounds for pw, hence RTE.

When an RTE happens, it is actually an Undefined behavior, which can result in any type of judgment -> TLE in this case.

  • »
    »
    22 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    But this submission is my AC submission!

    • »
      »
      »
      22 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      The difference isn't much the solution passed in 2979 ms. Maybe it took approx 20 ms to access the element in the array (j*a) times as it was in nested for which was then resolved by providing a constant value to hi. I am not very sure though.But still the code is too close to TLE.

    • »
      »
      »
      22 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Wait, did I catch a totally different bug lol.