CS 300
题意:给出一个数n,要求构造出n个点(x,y),(-10<=x,y<=10) 满足正好有n对点的距离为1. 1e-4<=其余的距离<1
n<=1024.
题意:给出一个数n,要求构造出n个点(x,y),(-10<=x,y<=10) 满足正好有n对点的距离为1. 1e-4<=其余的距离<1
n<=1024.
(0,0)放一点 单位圆上放n-1个点? 注意边界两个点的弦长不超过1,2rsina/2<=1 则圆心角<=pi/3.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=3e5+5,mod=1e9+7;
const double pi=acos(-1.0);
double n;
int main()
{
cin>>n;
cout<<"0 0"<<endl;
double ang=pi/3.0/(n-2);
for(int i=0;i<n-1;i++)
printf("%.12lf %.12lf\n",cos(i*ang),sin(i*ang));
return 0;
}