I use a header named printContainer.h for printing STL containers for debugging purposes, but I always have to comment it out before submission , sometimes I forget and get Compilation error which causes much problem and most importantly every second counts here... my template is like this:
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include<iomanip>
#include<cstring>
#include <queue>
#include "Templates/printContainer.h"
//Rest of the code
please tell me what to do? I heard ifdef or endif works but I couldn't make it work...maybe I am using the wrong way.
thanks a lot
Yeah you need to use ifdef and endif and define some custom macro when compiling:
And now whenever you're compiling you use
can I completely copy this code and submit in cf? and not get CE?
Yes. This just means that you only include this header if you compile with the macro LOCAL, which is not present in the online judge.
Also I just checked some of the other answers and they might be more convenient because you just compile normally without the need to provide a custom macro (5yearold's answer) so ig you can just use that.
see any of my submissions, u need to use #ifndef ONLINE_JUDGE and #endif directives. the code under these directives will not be executed by online judges of platforms like codeforces, atcoder and codechef. hope this helps.
THANKS A LOT SIR...I am checking
Thanks a lot