Блог пользователя _punk

Автор _punk, история, 5 лет назад, По-английски

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 :)

  • Проголосовать: нравится
  • +12
  • Проголосовать: не нравится

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится +32 Проголосовать: не нравится

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 лет назад, # |
  Проголосовать: нравится +20 Проголосовать: не нравится

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 лет назад, # ^ |
      Проголосовать: нравится +13 Проголосовать: не нравится

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

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

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

    • »
      »
      »
      5 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      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 лет назад, # ^ |
          Проголосовать: нравится +7 Проголосовать: не нравится

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