c++ sort() vs stable_sort(), WA

Правка en1, от Fred_Flintstone, 2017-08-27 14:37:52

Hi codeforces!

I was solving this problem: 100685J - Just Another Disney Problem and I solved it using c++ sort() (submission: 29823860), however I got WA and I was very confused as to why. Later I tried the same but using stable_sort() (submission: 29824442) and surprisingly I got AC. In the statement it says that "for every two of them he likes one of them more than another one" meaning that they have each different "beauty", thus stability is useless. I'd be very grateful if someone could explain me why my first submission failed, it's driving me crazy, I even wrote my first blog because of that!!!

Теги sort, stable_sort, c++, wrong answer, help, explain

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Fred_Flintstone 2017-08-27 14:37:52 650 Initial revision (published)