Hi everyone! for now i was using this#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
in my template ,howewer i got WA 2 times due to this pragmas.
i have heard that pragmas can cause TLE but i have never heard that this can cause WA. So can any one tell how pragmas really work and why it can cause WA?
Without any other information or a source code to look at, I can only speculate that it might have been a usual case of a https://en.wikipedia.org/wiki/Heisenbug
gcc at -O2 and up will try to remove as much code as possible (fastest code is nonexistent code) and if you happen to be using something that's reliable/predictable but technically undefined behavior, it'll look like sections of your code are just weirdly missing. A TLE can come from a loop being told to terminate after an int rolls over at its max, buuut since that predictable reliable rollover to min is technically undefined, the check that depends on that value will just get nuked and the loop allowed to run indefinitely. Again, given the 'take it out if undefined' behavior from some types of optimizations, it's not hard to imagine something similar resulting in a WA. Or not. Hard to say without any code.
https://pastebin.com/XTizxz2t exactly same code with pragmas get WA. however there is no statement in english so i cant give u a link for problem. But if u want i can tell u a problem statement its quite interesting problem indeed