_punk's blog

By _punk, history, 5 years ago, In English

whenever you are doing a question in which addition to a string requires , that is , we have to add an character into a string or we have to insert into a stack. Then instead of using '+' operator go for push_back. this help in lot of questions where you are doing a lot of '+' operation in a string. i got this when i was solving a question on geeks and i found TLE many times. Then I tried roughly push_back, and BOOM it worked XD. Thats where i learnt when you are not getting your answer when you are right , then go for rough guesses.

HAPPY CODING :)

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

»
5 years ago, # |
Rev. 2   Vote: I like it +32 Vote: I do not like it

You can use += also. This hack allows you to add a string to the right for O(the length of the string wich you want to add). For example, a += b working for O( len(b) )

»
5 years ago, # |
  Vote: I like it +20 Vote: I do not like it

Thats where i learnt when you are not getting your answer when you are right , then go for rough guesses.

Shit one says when he/she don't know computer science.

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

    tfw u have a 30 line segtree dp and u swear its an off by 1 error

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

    that was just for fun mate!!!!.. i know pretty well that everything goes with logic!!!

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

      Sure. But the way you wrote your post tells me that you don't have a very good grasp in C++ like many others who just code blindly without reading the STL docs.

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

        onwards to glory bro!!:)... ahh but not like others who just keep rolling their fingers on keyboard to get ACCEPTED..