ZOJ - 3488 Conic Section
来源:互联网 发布:淘宝可以买到美沙酮吗 编辑:程序博客网 时间:2024/05/19 04:54
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 Contest
看起来很可怕的一道题,其实很简单,不过是在高中知识还在的情况下,哈哈哈,我可是查了相关的定义才做出来的,太差了太差了
abcdef其实是有联系的,具体判定方法还是自行百度吧。
#include <iostream>#include <cstdio>#include <cstring>#include <string>using namespace std;int T;double a,b,c,d,e,f;int main(){ cin>>T; while(T--) { cin>>a>>b>>c>>d>>e>>f; if(b*b-4*a*c<0) { if(a==c&&(d*d+e*e-4*f>0)) cout<<"circle"<<endl; else cout<<"ellipse"<<endl; } else if(b*b-4*a*c==0) cout<<"parabola"<<endl; else if(b*b-4*a*c>0) cout<<"hyperbola"<<endl; } 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(圆锥曲线)
- 二叉树的遍历<递归算法实现>、<非递归算法实现>
- 油田问题(dfs)
- eclipse 导入c/c++ 源码
- sql on hadoop方案(5)
- ./startup.sh: /bin/sh^M: bad interpreter: 没有那个文件或目录 解决办法
- ZOJ - 3488 Conic Section
- 冒泡排序
- Android 关机实现
- 一边搭建一边理解MongoDB副本集(副本集读写语义)
- Fresco的使用
- 1029. Median (25)
- PAT A1075. PAT Judge (25)
- Ajax学习笔记
- redis集群搭建以及和spring整合