Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

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

Автор dholakpur_wala_raju, история, 7 месяцев назад, По-английски

A genuine question to all problem setters: why do most of the questions have $$$1$$$-based indexing and not $$$0$$$-based indexing (for instance, permutations, $$$[l,r]$$$ range queries, graph nodes are mostly $$$1$$$ to $$$n$$$ instead of $$$0$$$ to $$$n-1$$$. In my humble opinion, having $$$0$$$-based indexing just helps in writing a much cleaner code i.e. a slightly simplified implementation, like I can create an array of length $$$n$$$ instead of $$$n+1$$$, since computer uses $$$0$$$-based indexing and hence $$$1$$$-based indexing adds an unnecessary offset of $$$1$$$. This offset is most likely not the intention of the problem setter to judge the contestant on his/her problem-solving skills. However, I will mention that $$$1$$$-based indexing looks cleaner to human eyes but with respect to programming perspective, I really don't see any point other than missing it and getting an unnecessary WA.

Полный текст и комментарии »

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

Автор dholakpur_wala_raju, история, 15 месяцев назад, По-английски

Everyday people want to know how to become red. They will visit YouTube, LinkedIn, Codeforces and such other sites to find the answer but the hunt still continues. Hence, I will provide the solution for once and for all.

Step 1: Practice. Solve problems and give contests.

Step 2: Stop reading and watching tips. There is no magic. The answer is Step 1.

Полный текст и комментарии »

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