GYM 101061 D.Max or Min .. that is the question!(水~)
来源:互联网 发布:开票软件 编辑:程序博客网 时间:2024/06/08 10:14
Description
给出五个正整数,选俩使得其乘积最大
Input
第一行一整数T表示用例组数,每组用例输入五个整数a[i],a[i]互不相同不超过1000的正整数
Output
输出从a序列中选两个数的最大乘积
Sample Input
2
1 2 3 4 5
50 40 30 20 10
Sample Output
20
2000
Solution
纯净水
Code
#include<cstdio>#include<iostream>#include<cstring>#include<algorithm>#include<cmath>#include<vector>#include<queue>#include<map>#include<set>#include<ctime>using namespace std;typedef long long ll;#define INF 0x3f3f3f3f#define maxn 1111int T,a[6];int main(){ scanf("%d",&T); while(T--) { for(int i=0;i<5;i++)scanf("%d",&a[i]); sort(a,a+5); printf("%d\n",a[3]*a[4]); } return 0;}
0 0
- GYM 101061 D.Max or Min .. that is the question!(水~)
- 语言漫谈:Primitive, or non-primitive, that is the question
- To be or Not to be that is the question
- Solr or Elasticsearch–That Is the Question
- to be or not to be, that is a question...
- To be or not to be that is a question
- Issue 111( Most important discoveries or creation are accidental; it is usually while seeking the answer to one question that
- To be, or not to be; that is the question! 生存还是毁灭,这是个值得思考的问题。
- How to get the 2D coordinate of the max or min value in matrix in matlab
- 当IE向服务器发送数据的时候,这些数据是IE从哪里取得的呢?To block, or not to block? That is the question.
- FW - check whether tree is balanced or not - find the max and min of one tree- 2013年12月18日13:12:04
- GYM 100712 A.Who Is The Winner?(水~)
- The parameter is (or has an element that is) the wrong kind of geometry
- The parameter is (or has an element that is) the wrong kind of geometry
- Question 8: In which of the following scenarios is a Copy Constructor called or invoked?
- It is possible that this object was over-released, or is in the process......
- question1.Describe a day that you enjoy the most or is the most special for you.
- To Be a Coder or Not, That's a Question!
- Android数据存储之SQLite数据库存储
- SSM springmvc mybatis 整合 bootstrap maven shiro druid
- hadoop资料汇总
- android 用Path 绘制各种图形,Path的方法解析
- 递推递归练习 K 加强斐波那契
- GYM 101061 D.Max or Min .. that is the question!(水~)
- activiti工作流的web流程设计器整合视频教程 SSM和独立部署
- XML:XPath路径定义选取节点 XPath 使用路径表达式在 XML 文档中选取节点。节点是通过沿着路径或者 step 来选取的。 下面列出了最有用的路径表达式: 表达式描述 nodename
- 用Cython编译Python的C扩展
- java 企业网站源码 后台 springmvc SSM 前台 静态化 代码生成器
- Python的Cython在Windows环境下的部署安装
- OS X平台的Dylib劫持技术(上)
- Web服务器
- Java SSM 商户管理系统 客户管理 库存管理 销售报表 项目源码