laughing_philosopher's blog

By laughing_philosopher, history, 9 months ago, In English

I was solving the problem — https://mirror.codeforces.com/contest/976/problem/C

I got runtime Error for this submission — https://mirror.codeforces.com/contest/976/submission/332127114

But an AC for — https://mirror.codeforces.com/contest/976/submission/332127380

and the only difference between these two codes is use of stable_sort() (in AC sub) and sort() (in WA sub). When I searched on the internet I found out that the key difference between sort() and stable_sort() lies in their guarantee regarding the relative order of equivalent elements. But why would this lead to STATUS_ACCESS_VIOLATION?

Full text and comments »