For me a good way to debug was to print all stdin in my stderr. Then with the great tutorial https://www.codingame.com/playgrounds/53705/contest-tools-and-workflow/introduction from @eulerscheZahl you can easily get your stderr and replay games and debug them. Personally it was my first contest in C++ and I made great use of that to understand where my pointers/local variables went wrong in the global algorithm. In c++ I would have something like that:
bool isIde = false;
if (isIde) {
string myID = “1114834”;
ifstream* inputFile = new ifstream(“resources/467005582-” + myID + “-stderr.txt”);
cin.rdbuf(inputFile->rdbuf());
}
3 Likes