Just a heads up if someone else gets this bug:
#pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma")
I usually add these two lines of pragmas in my code. But on submitting it to the POI judge, it gives runtime error 4, and when excluded, it doesn't.
Would also be nice if someone could elaborate on why Runtime error 4 is returned on passing the pragmas.
With second pragma you allow compiler to use some assembly instructions which are not supported on some machines, and if some judge system uses different machines for compilation and execution, you may encounter such a problem. I'm not sure about POI, but with Yandex system it is exactly such case.
That's the case. Using pragmas is just asking for a problem in most cases imho.
Well,
Ofast
andsse
should work everywhere. But of course, using these pragmas makes sense only if you know and understand why you need them in specific solution.