主要就是将圆离散化,剩下的都好办

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
#define add 0.005
double x[],y[];
int main()
{
int t,n;
scanf("%d",&t);
x[] = y[] = ;
x[] = ,y[] = ;
x[] = 0.5,y[] = sqrt(0.75);
x[] = 0.5,y[] = y[]-;
for(int i = ;i <= ;i++)
{
x[i] = 0.5 + (i-) * add;
y[i] = sqrt( - x[i]*x[i]);
}
while(t--)
{
scanf("%d",&n);
if(n <= )
{
puts("No");
continue;
}
puts("Yes");
for(int i = ;i < n;i++)
{
printf("%.6lf %.6lf\n",x[i],y[i]);
}
}
}

FZU 2140 Forever 0.5(将圆离散化)的更多相关文章

  1. FZU 2140 Forever 0.5

     Problem 2140 Forever 0.5 Accept: 36    Submit: 113    Special JudgeTime Limit: 1000 mSec    Memory ...

  2. FZU 2140 Forever 0.5(找规律,几何)

    Problem 2140 Forever 0.5 Accept: 371 Submit: 1307 Special Judge Time Limit: 1000 mSec Memory Limit : ...

  3. FZU 2140 Forever 0.5 (几何构造)

    Forever 0.5 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit  ...

  4. ACM学习历程—FZU 2140 Forever 0.5(计算几何 && 构造)

    Description   Given an integer N, your task is to judge whether there exist N points in the plane su ...

  5. fzu Problem 2140 Forever 0.5(推理构造)

    题目:http://acm.fzu.edu.cn/problem.php?pid=2140 题意: 题目大意:给出n,要求找出n个点,满足: 1)任意两点间的距离不超过1: 2)每个点与(0,0)点的 ...

  6. 0. ACM系列算法

    0.1 数学 0.1.1 概率 http://www.cnblogs.com/jiu0821/tag/%E6%A6%82%E7%8E%87/ 0.1.2 代数 0.1.2.1 Polya 0.1.2. ...

  7. hdu 5233 离散化

    10^9的大数组显然开不了.所以也算比较裸的离散化了... 令pos[i].pp[j]表示从左到右第j个高度为i的树的位置 (pp是个vector,范围0..now-1) pos[i].num表示有几 ...

  8. poj3675 求多边形与圆的面积交

    题意:给出多边形的顶点坐标.圆的圆心坐标和半径,求面积交 sol:又是模板题啦= = 注意poj的C++好像认不出hypot函数,要稍微改写一下. hypot(double x,double y):即 ...

  9. IOS用CGContextRef画各种图形(文字、圆、直线、弧线、矩形、扇形、椭圆、三角形、圆角矩形、贝塞尔曲线、图片)

    ... 首先了解一下CGContextRef: An opaque type that represents a Quartz 2D drawing environment. Graphics Con ...

随机推荐

  1. HashMap和HashSet的源代码分析

    static final int DEFAULT_INITIAL_CAPACITY = 1 << 4; // aka 16 static final float DEFAULT_LOAD_ ...

  2. java中的Volatile 变量

    Java 语言中的 volatile 变量可以被看作是一种 “程度较轻的 synchronized”:与 synchronized 块相比,volatile 变量所需的编码较少,并且运行时开销也较少, ...

  3. app/desktop/view/index.html 显示授权标识

    app/desktop/view/index.html 显示授权标识

  4. js 中创建对象

    对象是什么 从JavaScript定义上讲对象是无序属性的集合,其属性可以包含基本值.对象或函数.也就是说对象是一组没有特定顺序的属性,每个属性会映射到一个值上,是一组键值对,值可以是数据或对象. 最 ...

  5. TCP/IP 和HTTP 协议基础知识

    来源:http://www.myhack58.com/Article/60/63/2014/50072.htm 相信不少初学手机联网开发的朋友都想知道Http与Socket连接究竟有什么区别,希望通过 ...

  6. 【ADT】队列的基本C语言实现

    queue.h #ifndef _QUEUE_H_ #define _QUEUE_H_ #include <stdbool.h> #define MAXQUEUE 10 // 定义队列类型 ...

  7. iOS 加载本地的html文件

    方法1: self.webView  = [[UIWebView alloc]initWithFrame:self.view.bounds]; NSString *path = [[NSBundle ...

  8. py执行系统命令

    1. os.system In [32]: run = os.system("date") Thu Jan 28 09:41:25 CST 2016 In [33]: run Ou ...

  9. msdn我告诉你

    http://msdn.itellyou.cn/ 微软旗下所有的msdn订阅软件资源 均为ed2k资源 Business Solutions MSDN Library 工具和资源 应用程序 开发人员工 ...

  10. 如何将excel导入到数据库中并在gridview中显示

    在页面上导入个excel文件,将该excel中的数据导入到数据库中,并且在页面的gridview中把数据显示出来. .在Asp.net中怎样将Excel文件中的数据导入到GridView中呢? 首先我 ...