hdu 5595 Math
来源:互联网 发布:数据库索引设计与优化 编辑:程序博客网 时间:2024/04/28 21:43
传送门:
http://acm.hdu.edu.cn/showproblem.php?pid=5595
大sb题,暴力就可以过,可是我当时却脑残的写了分类讨论,一直wrong
立个flag!!!
注意最小值可能是负数!!!
#include<bits/stdc++.h>using namespace std;int t,a,b,c,l,r;const int inf=0x3f3f3f3f;int cal(int n){ return a*n*n+b*n+c;}int main(){ cin>>t; while(t--){ scanf("%d%d%d%d%d",&a,&b,&c,&l,&r);int maxx=-inf; int minn=1e9+10; for(int i=l;i<=r;i++){ if(cal(i)>maxx){ maxx=cal(i); } minn=min(minn,cal(i)); } printf("%d %d\n",maxx,minn); } return 0;}
0 0
- hdu 5595 Math
- HDU 5595 GTW likes math
- Hdu 5595 GTW likes math
- HDU 5595 GTW likes math
- hdu 3927 Math Geek
- hdu 4427 Math Magic
- hdu 4427 Math Magic
- HDU 4427 Math Magic
- hdu 4427 Math Magic
- Math 之 hdu 1210
- hdu 2393 Higher Math
- 【HDU】5105 Math Problem
- HDU - 5105 Math Problem
- HDU-5105 Math Problem
- HDU 5105 Math Problem
- HDU 5105 Math Problem
- HDU 2393 Higher Math
- HDU - 2393 Higher Math
- 11210 - Chinese Mahjong
- Android APP内存优化之图片优化
- 二叉查找树 C++实现(含完整代码)
- 生成txt文件
- C++ 序列式容器之vector
- hdu 5595 Math
- C++内联函数
- ubuntu 安装之后需要做的
- C++ 合成默认构造函数的真相
- 编译器角度看C++复制构造函数
- HTMLParser使用
- hdu1423 Greatest Common Increasing Subsequence
- 【unity shaders】一 Unity中的Shader及其基本框架
- 解决DataGridView的图片列出现红叉