Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

nithinsanjey's blog

By nithinsanjey, history, 6 years ago, In English

I am a full time corporate programmer in Java for web development and a CS engineering graduate. Here I would like to share my experience through my first 4 Codeforces contests.

Programming for web development is a lot different from programming in competitive contests. In web, much work depends on where the data comes from(customer/database) and where the data goes to (database/UI). But here, in Codeforces, programming is Math. And so depends on algorithm and data structures. As Knuth points out,

Algorithm + Data structure = Programming

I would like to write on my learning in each part separately.

Algorithm

I was jumping into programming immediately on seeing the problem which worked well in A problems but not to others. I realize that I should I should take my pen & paper and make an algorithm before jumping into code. Otherwise I consumed a lot of time figuring out the algorithm while coding while paper is easier and more intuitive as a beginner(at least for me).

Also, I missed to cover corner cases in a few submissions. Though the solution is like 99% correct with core logic figured out, it is not good enough(obviously).

Data Structures

Some of my code failed/was hacked on submission because of the wrong data structure I choose. In C++ the range of various integer types should be known, Example : long long int for 10^10 values.

Also, some basic data structures that were useful in cases of B problems like set, map, etc.(of course arrays are everything). I happen to learn the usage of set, map, etc. while the contest was running. But they come in handy.

Note

Algorithm and data structure are equally important(as in Knuth's equation and knowing that addition is commutative). So my topic order should not be taken as to favor one over the other.

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

»
6 years ago, # |
  Vote: I like it +39 Vote: I do not like it

Feels like u wanna suck knuth's dick