HDU 5615 Jam's math problem
来源:互联网 发布:淘宝上显示喵喵折 编辑:程序博客网 时间:2024/06/08 23:20
题目:http://acm.hdu.edu.cn/showproblem.php?pid=5615
代码:
#include<stdio.h>#include<stdlib.h>#include<math.h>#include<string.h>#include<string>#include<algorithm>#include<iostream>using namespace std;int main(){ int T; scanf("%d",&T); long long a,b,c,s; for(int i=1;i<=T;i++){ scanf("%I64d%I64d%I64d",&a,&b,&c); long long s=b*b-4*a*c; double q=sqrt((s)); int p=(int)(q); if(q-p==0) printf("YES\n"); else printf("NO\n"); } return 0;}
分析:
题目要求pqmk为正整数即,根号下b*b-4*a*c为正整数,两个根为负数,即b大于根号下b*b-4*a*c(恒成立)。
0 0
- HDU 5615 Jam's math problem
- HDU 5615 Jam's math problem
- HDU 5615 Jam's math problem
- hdu 5615 Jam's math problem
- HDU-5615-Jam's math problem
- Hdu 5615 Jam's math problem【数学】
- hdu 5615 Jam's math problem
- HDU 5615:Jam's math problem【模拟】
- HDU 5615 Jam's math problem
- HDU 5615 Jam's math problem <数学>
- hdu 5615 (Jam's math problem)
- HDU Problem 5615 Jam's math problem 【十字交叉,暴力】
- 杭电hdu 5615 Jam's math problem【胡搞过】
- HDU 5615 Jam's math problem(模拟)
- HDU-5615(Jam's math problem)(方程求解)
- HDU 5615 Jam's math problem(十字相乘判定)
- HDU:5615 Jam's math problem(暴力,数学)
- HDU 5615 Jam's math problem(水~)
- JVM 优化经验总结
- 深入理解JVM性能调优
- Hadoop作业JVM堆优化汇总及JVM复用
- Android性能优化典范 - 第4季
- 1. Two Sum
- HDU 5615 Jam's math problem
- 大数据IMF传奇行动 UBUNTU的SSH SECURECRT不能登陆 与 vmvare net 8的问题解决
- ES6学习——模块化:import和export
- Java数组的复制方法
- 吕鑫MFC学习系列四
- 基本数据结构-heap实现
- 词
- C++中#ifndef/#define/#endif使用详解
- 子类的实例化过程