Problem A Forever 0.5(推理构造)
来源:互联网 发布:软件项目计划书 编辑:程序博客网 时间:2024/04/30 22:54
题目: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的圆上找点就行。
很巧妙的一道题目呀、、、、
按 Ctrl+C 复制代码
#include <iostream>#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
double x[110], y[110];
void slo()
{
x[0] = 0; y[0] = 0;
x[1] = 1; y[1] = 0;
x[2] = 0.5; y[2] = sqrt(1-0.5*0.5);
x[3] = 0.5; y[3] = y[2]-1;
for(int i = 4; i < 102; i++)
{
x[i] = 1-0.001*i;
y[i] = sqrt(1-x[i]*x[i]);
}
}
int main()
{
int t, n;
cin>>t;
slo();
while(t--)
{
cin>>n;
if(n<=3)
cout<<"No"<<endl;
else
{
cout<<"Yes"<<endl;
for(int i = 0; i < n; i++)
printf("%.6lf %.6lf\n", x[i], y[i]);
}
}
return 0;
}
按 Ctrl+C 复制代码
0 0
- Problem A Forever 0.5(推理构造)
- fzu 2140 Forever 0.5(推理)
- FZU 2140 Forever 0.5(构造)
- FZU Problem 2140 Forever 0.5
- 【构造】 FZU 2140 Forever 0.5
- FZU Problem 2140 Forever 0.5(计算几何构造,依旧考查思维)
- HDU 4972 A simple dynamic programming problem(推理)
- Problem A: 推理出今天是星期几
- A Forever Friend
- A Forever Friend
- A Forever Friend
- A forever friend
- A forever friend!
- A forever friend
- A Forever Friend
- HDU - 1757 A Simple Math Problem (构造矩阵)
- HDU 1757 A Simple Math Problem(构造矩阵)
- 【NOIP2017模拟赛】构造 A+B Problem(好题)
- 黑马是一场轰轰烈烈的革命
- __int64 与long long 的区别
- 第十二周项目一——阅读程序1(有静态局部变量的程序)
- 老师,请不要这样讲中国
- android 判断登录是否邮箱或手机号
- Problem A Forever 0.5(推理构造)
- Review of Codeforces 6B and 6C
- 第十二周上机项目三
- HDU 5095 Linearization of the kernel functions in SVM(模拟)
- POJ 2406--Power Strings(kmp算法)
- 实验四
- hdu 5104 Primes Problem(数学)
- Objective-C基础笔记(4)Category
- JAVA的反射机制与动态代理