ZOJ3488-Conic Section
来源:互联网 发布:广西广电网络多少钱 编辑:程序博客网 时间:2024/06/07 21:26
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.
Input
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.
Output
For each test case, output the type of conic section ax2+bxy+cy2+dx+ey+f=0. See sample for more details.
Sample Input
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
Sample Output
circleellipseparabolahyperbolacircle
References
- Weisstein, Eric W. "Conic Section." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/ConicSection.html
Author: WU, Zejun
Contest: The 8th Zhejiang Provincial Collegiate Programming Contes
题意:给出方程 ax2+bxy+cy2+dx+ey+f=0 的系数,判断该曲线是圆,椭圆,双曲线还是抛物线。
#include <iostream> #include <cstdio> #include <string> #include <cstring> #include <algorithm> #include <cmath> #include <queue> #include <vector> #include <set> #include <stack> #include <map> #include <climits> using namespace std; #define LL long long const int INF=0x3f3f3f3f; int main() { int t; scanf("%d",&t); while(t--) { double a,b,c,d,e,f; scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f); if(a==c) printf("circle\n"); else if(a*c>0) printf("ellipse\n"); else if(a*c==0) printf("parabola\n"); else printf("hyperbola\n"); } return 0; }
- ZOJ3488-Conic Section
- ZOJ3488 Conic Section(圆锥曲线)
- Conic Section
- Conic Section
- Conic section
- conic section
- B Conic Section
- 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
- zoj3488
- ZOJ 3488 Conic Section(数学啊 )
- 主线程给子线程发送消息
- Gated Recurrent Neural Networks
- C#编程基础 实验(7) (1-2)
- 神经网络概述
- (网络层)IP 协议首部格式与其配套使用的四个协议(ARP,RARP,ICMP,IGMP)
- ZOJ3488-Conic Section
- Ubuntu下adb 显示insufficient permissions for device,或Eclipse中DDMS设备显示?????
- iOS应用架构谈 网络层设计方案(转)
- JavaScript界面演示 交换排序
- Apriori算法详解之【一、相关概念和核心步骤】
- Android Studio使用新的Gradle构建工具配置NDK环境
- 获取Java Exception异常详细信息,以便保存
- poj 2253 Frogger
- 分布式服务框架Dubbo入门案例和项目源码