Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems. ×

leafvillageninja's blog

By leafvillageninja, history, 2 months ago, In English,

In today's contest, I got a WA in problem 3. So I thought of doing a stress testing of my solution, but my workflow was so slow that it took me around 1 hour to debug my code. Is there anything I should improve so that I can do such debugging fastly in contests? I am describing the steps I did: I wrote a brute force solution. I wrote code for randomly generating the test cases. I then ran both the solutions I had against the generated test-cases. I then used https://www.diffchecker.com/ to find the difference between both the outputs. I then opened the randomly generated tests file (which had 300+ test cases) and then navigated to the test case for which the output was different. Then I ran that particular test case separately and did the debugging.

Read more »

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

By leafvillageninja, history, 18 months ago, In English,

Happy holidays!

You might have stumbled across the largest online encyclopedia of integer sequences (OEIS) when finding the solution to a competitive programming problem. OEIS helps a lot of researchers and students around the world. The website of OEIS (http://oeis.org/) is supported by donations to a not-for-profit organization, The OEIS Foundation. They conduct appeals once every year where they ask people to donate to them. So, if you can afford, consider donating to them this year. The link to donate is available on their homepage.

PS: I am in no way associated with OEIS, and I won't receive any benefit from the funds you're going to donate. I just want to see OEIS growing. That's why I posted this.

Read more »

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

By leafvillageninja, history, 19 months ago, In English,

Isn't it a good idea to use a macro which replaces all the instances of endl with "\n" in all of my C++ programs to speed-up my code because doing so will stop unnecessary flushing of stdout?

Asking this because I have never seen anyone using such a macro.

Of course, in certain problems like the interactive ones, where I have to flush stdout, I will have to write fflush(stdout) separately.

Read more »

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