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

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

Note that the environment i am sharing is what I made from compiling a few sources here and there. I myself was facing some difficulty being a newbie in this as I usually used just Vim, so I figured adding it here would help some people save time and brain cells

  • First, I use VSCode for coding in C++ language (You can also setup NeoVim like VSCode but there were so many good extensions available on VSCode that i shifted to this one, also let's be honest: resolving dependencies in Vim is mehh..).

  • Second, you need to get a template .cpp file ready so that you don't have to waste time on it on every problem. I will not be giving that one here, as you should look at what template suits the best for you (Start looking in code submissions from higher rated coders here and see what all they use in their templates) (: I myself forgot from which sources I stole my template file ^__^ )

  • Third, and the main reason for writing this blog, get CodeForces Programming Extension Helper (from here: https://codeforces.net/blog/entry/71386) (Codeforces is only in the name, otherwise it works on all the online judges) You can add whatever testcase you want easily and test on it. You just have to click the extension in your browser and the extension parses the question and testcases in your VSCode locally
  • Fourth, you need to learn how to use debug statements instead of cin/cout for testing. I have added the lines you will need to add in your template file to use dbg statements easily.

Debug temp code [Just last 4 lines are relevant for us mortals]


  • Fifth, you dont need to submit manually by copy pasting your code everytime on the platform's code editor (atleast in codeforces). Just setup the Codeforces command line interface tool from here: https://codeforces.net/blog/entry/66552 and with just one command you can submit your codeforces code with this API.
  • Проголосовать: нравится
  • +13
  • Проголосовать: не нравится