Temat: Jakby bug w gcc?

Używam clanga bo tak mi wygodniej:

$ time ../lid.exe < lid5a.in
2166

real 0m0.026s
user 0m0.021s
sys 0m0.002s

$ gcc --version
Apple clang version 14.0.0 (clang-1400.0.29.202)

Ten sam program skompilowany gcc -O2 (inny komputer, też stary):

$ time ./lid.exe < ./lid5a.in
2166

real 0m2.484s
user 0m2.472s
sys 0m0.012s

$ gcc --version
gcc (Debian 12.2.0-14) 12.2.0

Efekt - przekroczenia czasu w B1 :-(
Heh - opuściłem & w komparatorze. clang wyoptymalizował a gcc nie.

struct Cmp {
Counts& cnt;

bool operator() (int const a, int const b) {
...
}
};