• assembler
  • Almost useless knowledge

    Is almost useless because nobody is going to raise yours salary for that! Or maybe someone will?!? Let’s say we ignore all the benefits of all the optimizations our benevolent compiler is going to made on our code, and have a look at what happen when we execute some hundreds of thousands of times two very […]

  • Algorithms
  • Solution space.

    Certain problems required us to try all the possible solutions to find the one that best fit the given constraint, a very popular brute force way is to perform a complete search of the solution space by iterating over and over the data and changing each time the input variables. If the problem require to […]

  • Books
  • Summary for the week.

    This was a very long week! Most of my free time I was at the gym or on my combinatorics book learning fancy details about the pigeonhole principle, which is very simple but with large implications in problem solving. The pigeonhole principle basically say that if you want to put three pigeon in two holes, […]

  • Algorithms
  • Subsequences and Fenwick tree’s

    Let’s say that we have a sequence A of 1<=n<=10^5 elements, and that this sequence may or may not be ordered but all the numbers {1…n} are present exactly once. And now given 1<=k<=10, you’re asked to find all the increasing sub-sequences of A with exactly k+1 elements. This is a problem I get from a competitive programming […]

  • C++
  • IO Stream performance.

    Many of  the competitive programming portals available on the web advice –for certain problems involving huge input reading or output printing– the user to avoid cin/cout in spite of printf/scanf: As input/output can reach huge size it is recommended to use fast input/output methods: for example, prefer to use scanf/printf instead of cin/cout in C++, prefer to use […]