https://mirror.codeforces.com/problemset/problem/1307/D↵
↵
In the problem a sorting technique is needed. I read the editorial have elements 1 to N. Each element has two values xi and yi.↵
Now I want to choose two elements a,b such that min(xa+yb,xb+ya) is maximized.↵
There is a naive n^2 solution to check every pair of elements. But it is possible to do it in nlogn complexity.↵
The problem link mentioned above has the editorial that describes the method but I couldn'tunderstandget it. Can someanyone explain that?
↵
I
Now I want to choose two elements a,b such that min(xa+yb,xb+ya) is maximized.↵
There is a naive n^2 solution to check every pair of elements. But it is possible to do it in nlogn complexity.↵
The problem link mentioned above has the editorial that describes the method but I couldn't