Query regarding header files

I have seen many top coders writing many header files explicitly and not using bits/stdc++.h. Does using bits/stdc++.h have any disadvantages?

No, it doesnt.

Usually many IDE , or other online compilers have a fixed template. Like when you see codechef ide (say, for c++) some things are written by default. Sinilarly, in those ide, those header files are included by default.

Its usually recommended to use bits stdc++.h instead of including each file indiviually, as it saves time for writing the code (imp for short contest)

2 Likes

Yes, but bits/stdc++.h increases the compilation time.

1 Like

I believe solutions are judged on running time and not compilation time and since it’s not very huge difference, it doesn’t matter much.

Or maybe if thousands of contestants doing that at same time might be the reason for slow submissions, who knows xD.

1 Like

Thats the only downside. But consider the pro v/s cons, i will recommend it. (If algo is fine, it shouldnt give you tle. Also in many contest, ones submitting solution first are ranked higher [it happens in hackerrank.com ]. I feel one should use it for short contests)