ZOJ 3488Conic Section
来源:互联网 发布:淘宝上的宠物狗能买吗 编辑:程序博客网 时间:2024/05/19 02:27
The conic sections are the nondegenerate curves generated by the intersections of a plane with one or two nappes of a cone. For a plane perpendicular to the axis of the cone, a circle is produced. For a plane that is not perpendicular to the axis and that intersects only a single nappe, the curve produced is either an ellipse or a parabola. The curve produced by a plane intersecting both nappes is a hyperbola.
There are multiple test cases. The first line of input is an integer T ≈ 10000 indicating the number of test cases.
Each test case consists of a line containing 6 real numbers a, b, c, d, e, f. The absolute value of any number never exceeds 10000. It's guaranteed that a2+c2>0, b=0, the conic section exists and it is non-degenerate.
For each test case, output the type of conic section ax2+bxy+cy2+dx+ey+f=0. See sample for more details.
51 0 1 0 0 -11 0 2 0 0 -10 0 1 1 0 01 0 -1 0 0 12 0 2 4 4 0
circleellipseparabolahyperbolacircle
References
- Weisstein, Eric W. "Conic Section." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/ConicSection.html
#include<map>#include<cmath> #include<queue> #include<string>#include<vector>#include<cstdio> #include<cstring> #include<iostream>#include<algorithm> using namespace std;#define ms(x,y) memset(x,y,sizeof(x)) #define rep(i,j,k) for(int i=j;i<=k;i++) #define per(i,j,k) for(int i=j;i>=k;i--) #define loop(i,j,k) for (int i=j;i!=-1;i=k[i]) #define inone(x) scanf("%d",&x) #define intwo(x,y) scanf("%d%d",&x,&y) #define inthr(x,y,z) scanf("%lf%lf%lf",&x,&y,&z) typedef long long LL;const int low(int x) { return x&-x; }const int INF = 0x7FFFFFFF;const int mod = 1e9 + 7;const int N = 1e5 + 10;int T, n;double a, b, c, d, e, f;int main(){for (inone(T); T--;){inthr(a, b, c); inthr(d, e, f);if (a * c > 0) puts(a == c ? "circle" : "ellipse");else puts(a*c ? "hyperbola" : "parabola"); }return 0;}
- zoj 3488 Conic Section
- zoj - 3488 - Conic Section
- ZOJ 3488 Conic Section
- ZOJ 3488 Conic Section
- zoj 3488 Conic Section
- ZOJ 3488 Conic Section
- ZOJ 3488Conic Section
- ZOJ - 3488 Conic Section
- ZOJ 3488Conic Section
- ZOJ 3488 Conic Section(数学啊 )
- ZOJ-3488-Conic Section【8th浙江省赛】
- Conic Section
- Conic Section
- Conic section
- conic section
- B Conic Section
- ZOJ3488-Conic Section
- ZOJ3488 Conic Section(圆锥曲线)
- Linux多线程编程(二)-----同步与互斥
- wireshark浅析tcp三次握手
- 图像处理算法(一)---图像常用格式
- Libsvm和Liblinear各自特点和使用经验
- 序列化与反序列化
- ZOJ 3488Conic Section
- 【开源.NET】 分享一个前后端分离的轻量级内容管理框架(第二篇前后端交互数据结构分析)
- Java设计模式(5)--适配器模式
- UML 九种图
- 编写Android中的蓝牙模块驱动和底层HART设备
- ZOJ 3489Old Labels
- tslib库的安装和基于触摸屏的应用程序开发基础
- Servlet单例多线程问题
- SpringMVC几种重定向以及携带参数的处理