CF 706C

Ideas (mathematics proof + induction):

See symmetry -> take the absolute value of the coordinates -> For two people, take the point where the distance does not cross, and the cost is less than the point where the distance crosses (both sides and greater than the third side) -> and so on, for everyone, don't There are crossovers——>Everyone must take the nearest, otherwise there must be crossovers

 

#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll k,n,m,a[100005],ans,ansl,b,A;
int i,j,l,r,T; 
char ch[150];













     
     

 
     











         


 


return 0;
 
    
}

Guess you like

Origin blog.csdn.net/haobang866/article/details/114649294