These four solutions https://www.spoj.pl/status/HIGHWAYS,shkoorah/contain the absolutely same code in which I use container "set" and don't use iostream or scanf/printf.4.0.0-8 (older version) is a little bit faster and three times (!) greedy.Why faster?Why greedy?
GCC 4.0.0 was released in 2005, and GCC 4.3 was in 2008. That's a lot of development to be sure.
Here's the links to the changelogs:gcc.gnu.org/gcc-4.3/gcc.gnu.org/gcc-4.2/gcc.gnu.org/gcc-4.1/gcc.gnu.org/gcc-4.0/
Thank you
But I don't understand why newer version of gcc is a bit slowly than older version?I believe time of execution is very important characteristic.
And why difference in memory is so big?4.0.0-8 version was so bad optimized?