CS 300 Equidistant Points 构造(圆上等距离点)
来源:互联网 发布:淘宝店招牌尺寸 编辑:程序博客网 时间:2024/04/30 10:36
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;}
阅读全文
0 0
- CS 300 Equidistant Points 构造(圆上等距离点)
- 已知线段端点坐标,求线段上等距离的点坐标序列
- ArcGIS获取线段上等间距的点
- CS 300 Consecutive Digits Signs 构造
- CS 300 Spanning Trees 构造,生成树
- poj 1981 Circle and Points(圆覆盖点问题)
- POJ1981Circle and Points【单位圆能覆盖的最多点】
- Circle and Points----单位圆覆盖最多点
- CS 300 Tree Antichain 构造,树,二分染色
- UIPageControl设置圆点之间距离
- hdoj 5626 Clarke and points (曼哈顿距离)
- TFS - 测试点 Test Points
- CS 400 Coprime Pairs 构造!!!
- CS 400 BFS-DFS 构造
- 点到点距离
- 最接近点对距离
- Unicode Code Points (Unicode代码点)
- 共线点Max Points on a Line
- 基于R-FCN的物体检测
- poj3140
- 006_跨平台开发_MUI_折叠面板(accordion)
- 第一篇文章献给idea加码云
- USACO1.3牛式 Prime Cryptarithm
- CS 300 Equidistant Points 构造(圆上等距离点)
- 对ROC和KS曲线的理解
- ZJU1508 Intervals选数
- MFC VS2013 error LNK1104: 无法打开文件“C:\Users\Desktop\显示两个指标\Debug\FaceTempture.exe”
- C++中的命名空间
- Hibernate OID、导航图、HQL、SQL、QBC查询方式示例
- 人生最大的遗憾,莫过于没有程序员男友
- hashmap集合类用法
- UVa11388