Comment

avatar username

Your approach is correct. I didn't read the code that you submitted in contest, but I fixed the brute force implementation you submitted after. Your mistake was using std::set instead of std::multiset: https://codeforces.com/contest/2051/submission/297964342

The actual rating of this user is 1358.

Original comment.

Statistics