agc039 D

Gravity: the intersection of the center line 23 of the
orthocenter: the intersection of three high
heart: the angle bisector of the intersection of three
intersection three perpendicular bisectors: circumcenter

Consider a circle on the triangle ABC, we take the midpoint of the three arcs, referred to as A 'B' C '
problem solutions started! "It can be proved here that" ABC heart and A'B'C 'orthocenter is the same
solution to a problem they started! "It is known that" for a triangle, its orthocenter, center of gravity, Circumcenter in a straight line, and | orthocenter - the center of gravity |: | center of gravity - Circumcenter | = 2: 1
and then we are actually looking for is A'B 'C' is the orthocenter, and A'B'C 'circumcenter (0,0), the coordinates of the center of gravity of the three points is divided by 3, the coordinates of the center of gravity of the orthocenter is multiplied by three, i.e. three coordinates and the.

Then we enumerate two points, consider the third point contribution
may wish to call these two points BC, apparently A point on the major arc of time, A 'on the minor arc, and vice versa,
then the points will be multiplied by the contribution number to

#include <bits/stdc++.h>
#define yxn inline
using namespace std;
typedef double db;
typedef long long ll;
const db pi = acos(-1);
int n,l;db t[3003],x,y;
yxn void add(db rad,int cnt){
    x+=cos(rad)*cnt;
    y+=sin(rad)*cnt;
}
int main(){
    scanf("%d%d",&n,&l);
    for(int i=0;i<n;i++){
        scanf("%lf",&t[i]);
        t[i]=t[i]/l*2*pi;
    }
    sort(t,t+n);
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            db m1=(t[i]+t[j])/2,m2=m1+pi;
            add(m1,i+n-j-1);
            add(m2,j-i-1);
        }
    }
    db all = 1.0*n*(n-1)*(n-2)/6;
    x/=all,y/=all;
    printf("%.11f %.11f\n",x,y);
}

Guess you like

Origin www.cnblogs.com/MXang/p/11627611.html
d
d'd