题目:http://acm.fzu.edu.cn/problem.php?pid=2140

题意:

题目大意:给出n,要求找出n个点,满足: 
1)任意两点间的距离不超过1; 
2)每个点与(0,0)点的距离不超过1; 
3)有n对点之间的距离刚好为1; 
4)n个点组成的多边形面积大于0.5; 
5)n个点组成的多边形面积小于0.75;

思路:只要有4个点以上就是,构造时先找出四个点,再在半径为1的圆上找点就行。

很巧妙的一道题目呀、、、、

 #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std; double x[], y[];
void slo()
{
x[] = ; y[] = ;
x[] = ; y[] = ;
x[] = 0.5; y[] = sqrt(-0.5*0.5);
x[] = 0.5; y[] = y[]-;
for(int i = ; i < ; i++)
{
x[i] = -0.001*i;
y[i] = sqrt(-x[i]*x[i]);
}
}
int main()
{
int t, n;
cin>>t;
slo();
while(t--)
{
cin>>n;
if(n<=)
cout<<"No"<<endl;
else
{
cout<<"Yes"<<endl;
for(int i = ; i < n; i++)
printf("%.6lf %.6lf\n", x[i], y[i]);
}
}
return ;
}

最新文章

  1. java读取项目根路径下和任意磁盘位置下的properties文件
  2. cocos IDE 编译lua 游戏程序的环境配置
  3. entity framework 新手入门篇(1.5)-lambda表达式与linq
  4. 手把手教你如何加入到github的开源世界!
  5. python模块介绍- collections(5)-OrderedDict 有序字典
  6. ArrayList和Vector以及synchronizedList
  7. Win7下的本地网站发布
  8. hdu 2883 kebab 网络流
  9. glog使用
  10. Android笔记5-与USB HID 设备通信(一)
  11. VC实现卡拉OK字幕叠加
  12. --@angularJS--指令之单个点击展开demo
  13. tomcat设置错误页面
  14. 将replicated数据与元数据关联
  15. 从零开始学 Web 之 Vue.js(三)Vue实例的生命周期
  16. hdu3861 强连通分量缩点+二分图最最小路径覆盖
  17. python抽象方法
  18. 字典学习(Dictionary Learning, KSVD)详解
  19. 20170728xlVba还是这个混蛋
  20. 【转】每天一个linux命令(52):ifconfig命令

热门文章

  1. WPF中使用ValueConverter来实现“范围条件触发器”
  2. Team Homework #3
  3. 活动 Activity 四种加载模式
  4. Flv 视频格式(转)
  5. 仅仅测试Word2016发布博客
  6. 传说中的Markov&quot;不过如此”
  7. BZOJ 3436: 小K的农场 差分约束
  8. PHP之SQL防注入代码集合(建站常用)
  9. 【锋利的JQuery-学习笔记】遮罩层
  10. LoadAssetAtPath 与 Load 的区别