soda_bottle's blog

By soda_bottle, history, 18 months ago, In English

After solving a couple hundred of codeforces (at coder) problems I have noticed that these problems usually have one or more mathematical properties which is the main "puzzle" and once that is identified/cracked, implementing the solution is relatively straightforward. I do find such kind of problems really fun to solve and admire the writers who come up with such great ideas.

However, looking at other platforms like Google Kickstart, CS Academy etc. I noticed that the difficult problems there are less math heavy but are more "algorithmic" and have nuances that are less straightforward to observe as they don't have any sort of "elegant" math property. To understand more clearly, look at the editorial of this problem — https://csacademy.com/contest/fii-code-2020-round-2/task/escaping-courses/statement/ Ideas like "defining a node as (cell,time-interval)" and "using two queues to remove log factor" etc, are pretty difficult to come up with in my opinion.

After solving numerous cf problems my math/induction/greedy intuitions have improved drastically, but I lack skill to solve problems of the category described above. I'm sure such problems are present in CF too, since CF contestants do well on all sorts of problems. But I'm unable to find the right filters to find such problems.

I hope I can get some help!

Thanks All!

Full text and comments »

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

By soda_bottle, history, 4 years ago, In English

Problem E — Can anyone tell me how to get the answer in 4 moves for the following input? 8 6 6 1 6 3 1 8 8 10, AC program outputs 4. Link to problem — https://codeforces.me/contest/1481/problem/E

Full text and comments »

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

By soda_bottle, history, 4 years ago, In English

Sometimes, problems have a greedy element associated with them. Once this observation/inference is made we can easily solve the problem using known techniques such as binary search/dynamic programming/brute force etc.
But often times, it is really difficult to prove such observations. We make an intelligent guess for example — "I infer that after all operations have been performed only odd numbers will be left in the array ..." — and kind of have trust that it will work. But, if unable to come up with a proof, people use different techniques such as writing a brute force to observe a pattern, or visualizing etc. to increase certainty of some statement being correct. Or in other times, people might just know the fact from a previous problem. Can people share their experiences in these situations? And workaround methods?

Full text and comments »

  • Vote: I like it
  • -11
  • Vote: I do not like it