valiii's blog

By valiii, history, 4 hours ago, In English

Yesterday, I faced a very weird issue in the question 380C - Sereja and Brackets, where my code kept on exceeding time limit. First submission: 302321365 Used 3 vectors in this to track the brackets. Fourth submission: 302322577 only modification is changing the 3 vectors into a tuple vector, still TLEs. Sixth submission: 302341164, removed the long long definition, and also commented out the overriden functions and used the original query and build directly, still exceeds the time limit. Finally, AC: 302344021 convert the tuple into a Node, and it got accepted. Can someone tell me why all submissions other than the last faced time limit exceeded even though the build and query function was the same in all of them?

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

»
3 hours ago, # |
  Vote: I like it +3 Vote: I do not like it

Because you don't send string by reference (&) in build function, without reference he's copy every time call function

  • »
    »
    3 hours ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    I just resubmitted a previous submission by modifying that, and that was indeed the problem. Thank you, will keep that in mind from now on

»
3 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Sir how can get green sir pls sir tell me how i can get green sir may i dm