【构造】 FZU 2140 Forever 0.5
来源:互联网 发布:类似弹个车的软件 编辑:程序博客网 时间:2024/06/10 01:46
点击打开链接
题意:输入N,表示有N个点,
要求:
1.任意两点的距离≤ 1.0
2.每个点与原点的距离≤1.0
3.有N对点间的距离=1.0
4.N个点形成的面积≥0.5 ≤0.75
可以先取一个以原点为顶点,另外两个点在单位圆上的正三角形
其他的点就在圆弧BC上
将BC等分
而且N==4时 第四个点必须要在BC中点上
#include <cstdio>#include <cstdlib>#include <cstring>#include <climits>#include <cctype>#include <cmath>#include <string>#include <sstream>#include <iostream>#include <algorithm>#include <iomanip>using namespace std;#include <queue>#include <stack>#include <vector>#include <deque>#include <set>#include <map>typedef long long LL;typedef long double LD;const double eps=1e-8;#define pi acos(-1.0)#define lson l, m, rt<<1#define rson m+1, r, rt<<1|1typedef pair<int, int> PI;typedef pair<int, PI> PP;#ifdef _WIN32#define LLD "%I64d"#else#define LLD "%lld"#endif//#pragma comment(linker, "/STACK:1024000000,1024000000")//LL quick(LL a, LL b){LL ans=1;while(b){if(b & 1)ans*=a;a=a*a;b>>=1;}return ans;}//inline int read(){char ch=' ';int ans=0;while(ch<'0' || ch>'9')ch=getchar();while(ch<='9' && ch>='0'){ans=ans*10+ch-'0';ch=getchar();}return ans;}//inline void print(LL x){printf(LLD, x);puts("");}//inline void read(double &x){char c = getchar();while(c < '0') c = getchar();x = c - '0'; c = getchar();while(c >= '0'){x = x * 10 + (c - '0'); c = getchar();}}//inline void sc(LL &x){scanf(LLD, &x);}int main(){ int n,t; cin>>t; while(t--) { cin>>n; if(n<4) printf("No\n"); else { printf("Yes\n"); printf("%.6lf %.6lf\n",0.0,0.0); printf("%.6lf %.6lf\n",1.0,0.0); printf("%.6lf %.6lf\n",0.5,sqrt(3.0)/2.0); double st; for(int i=1;i<=n-3;i++) { st=(pi/3.0/(n-2))*i; double xx=cos(st); double yy=sqrt(1-xx*xx); printf("%.6lf %.6lf\n",xx,yy); } } } return 0;}
2 0
- 【构造】 FZU 2140 Forever 0.5
- FZU 2140 Forever 0.5(构造)
- FZU 2140 Forever 0.5
- FZU 2140Forever 0.5
- FZU 2140 Forever 0.5
- FZU-2140-Forever 0.5
- FZU 2140 Forever 0.5
- fzu-2140 Forever 0.5
- fzu 2140 Forever 0.5(推理)
- FZU Problem 2140 Forever 0.5
- FZU Problem 2140 Forever 0.5(计算几何构造,依旧考查思维)
- FZU OJ 2140 Forever 0.5 (几何)
- FZU 2140 Forever 0.5(计算几何)
- Forever 0.5 FZU 1240
- FZU 2140 Forever 0.5(找规律,几何)
- FZU 2140 Forever 0.5 (几何_思维)
- Problem A Forever 0.5(推理构造)
- ACM--数学几何--2140 Forever 0.5--水
- 十一月总结
- LA 6540 Fibonacci Tree
- maven报错非法字符:\65279 错误
- 【转】sublime中BracketHighlighter插件高亮设置方法
- 【工程数学】若干种计算圆周率的算法
- 【构造】 FZU 2140 Forever 0.5
- 为表的添加中文属性时出现的Incorrect string value: '\xE7\x9A\x84\xE6\xB1\xEA...
- Python基础语法
- Maven+Jenkins+Svn+Tomcat
- 14. Dubbo原理解析-集群&容错之Cluster
- VB.Net数据库编程
- 设置组件的长和宽 LayoutParams以及获得屏幕的宽和高
- 第十五周项目 指针法交换两个整数
- SpringMVC入门学习(一) 环境搭建+实例演示