ZOJ-3488-Conic Section【8th浙江省赛】
来源:互联网 发布:ubuntu 安装 没有硬盘 编辑:程序博客网 时间:2024/05/05 23:14
3488-Conic Section
Time Limit: 2 Seconds Memory Limit: 65536 KB
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
5
1 0 1 0 0 -1
1 0 2 0 0 -1
0 0 1 1 0 0
1 0 -1 0 0 1
2 0 2 4 4 0
Sample Output
circle
ellipse
parabola
hyperbola
circle
题目链接:ZOJ-3488
题目大意:给出
题目思路:判断a,c即可。时隔一年再写这题,还是掉到了坑里面去 注意,数字范围是实数!
以下是代码:
#include <iostream>#include <cstdio>#include <cmath>#include <vector>#include <cstring>#include <algorithm>#include <string>#include <set>#include <functional>#include <numeric>#include <sstream>#include <stack>#include <map>#include <queue>#include<iomanip>using namespace std;int main(){ int t; cin >> t; while(t--) { double a,b,c,d,e,f; cin >> a >> b >> c >> d >> e >> f; if (a == c) cout << "circle\n"; if (a * c > 0 && a != c) cout << "ellipse\n"; if (a == 0 || c == 0) cout << "parabola\n"; if (a * c < 0 && a != c) cout << "hyperbola\n"; } return 0;}
- ZOJ-3488-Conic Section【8th浙江省赛】
- 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-3490-String Successor【8th浙江省赛】【模拟】
- The 8th Zhejiang Provincial Collegiate Programming Contest / B - Conic Section
- The 8th Zhejiang Provincial Collegiate Programming Contest->B - Conic Section
- ZOJ-3603-Draw Something Cheat【字符串】【9th浙江省赛】
- ZOJ-3607-Lazier Salesgirl【模拟】【贪心】【9th浙江省赛】
- ZOJ-3879-Capture the Flag【模拟】【12th浙江省赛】
- ZOJ-3870-Team Formation【位运算】【12th浙江省赛】
- C#中WinForm程序退出方法
- 【MDCC2015】 平台与技术-Android专场(下):共享Android应用开发经验
- [POJ1067]取石子游戏(威佐夫博弈)
- 二叉树的各种遍历操作
- 设计模式之建造者模式
- ZOJ-3488-Conic Section【8th浙江省赛】
- 三极管基极电阻的确定方法
- bzoj 2127(最小割)
- UVA1152 4 Values whose Sum is 0
- Hive中的数据类型和文件格式
- Java时间类浅析
- js
- UML之协作图
- JavaScript定时器和进度条案例