A Compatible Pair
Description
Input
Output
输出单个整数——所选灯笼对的亮度。
Sample Input
2 2
20 18
2 14
252
5 3
-1 0 1 2 3
-1 0 1
2
Hint
#include <iostream>
#include <cstdio>
#include <climits>
using namespace std;
int main()
{
long long int a[],b[],maxn;
int i,j,n,m,k;
scanf("%d%d",&n,&m);
for(i=; i<n; i++)
{
scanf("%lld",&a[i]);
}
for(i=; i<m; i++)
{
scanf("%lld",&b[i]);
}
maxn=LLONG_MIN;
for(i=; i<n; i++)
{
for(j=; j<m; j++)
{
if(a[i]*b[j]>maxn)
{
maxn=a[i]*b[j];
k=i;
}
}
}
maxn=LLONG_MIN;
for(i=; i<n; i++)
{
if(i==k)
{
continue;
} for(j=; j<m; j++)
{
if(a[i]*b[j]>maxn)
{
maxn=a[i]*b[j];
}
}
}
printf("%lld\n",maxn);
return ;
}
A Compatible Pair的更多相关文章
- Codeforces 934.A A Compatible Pair
A. A Compatible Pair time limit per test 1 second memory limit per test 256 megabytes input standard ...
- Codeforces Round #462 (Div. 2) A Compatible Pair
A. A Compatible Pair time limit per test1 second memory limit per test256 megabytes Problem Descript ...
- Codeforces 934 A.Compatible Pair
http://codeforces.com/contest/934 A. A Compatible Pair time limit per test 1 second memory limit p ...
- CF934A A Compatible Pair
A Compatible Pair time limit per test 1 second memory limit per test 256 megabytes input standard in ...
- A - A Compatible Pair
Problem description Nian is a monster which lives deep in the oceans. Once a year, it shows up on th ...
- 题解 CF934A 【A Compatible Pair】 ——贪心
题意: 给定两个数列 \(A\) . \(B\) ,元素个数分别为 \(n\) , \(m\) \((2 \le n,m \le 50)\) .数列中所有元素大小均在 \(-10^{9}\) 到 \( ...
- CF934A A Compatible Pair 题解
Content 有两个数列 \(A\) 和 \(B\),\(A\) 数列里面有 \(n\) 个元素,\(B\) 数列里面有 \(m\) 个元素,现在请从 \(A\) 数列中删除一个数,使得 \(A\) ...
- A - A Compatible Pair-biaobiao88
A - A Compatible Pair Nian is a monster which lives deep in the oceans. Once a year, it shows up on ...
- pair queue____多源图广搜
.简介 class pair ,中文译为对组,可以将两个值视为一个单元.对于map和multimap,就是用pairs来管理value/key的成对元素.任何函数需要回传两个值,也需要pair. 该函 ...
随机推荐
- php 当不确定用户输入的是浮点 还是整数 还是字符串时
$price = (floatval($price))?intval(floatval($price)*100)/100:0;
- linux系统中用户
一.用户身份介绍: 1.系统管理员用户,UID(User IDentification) :0, 2.系统用户,UID为1~999,默认的程序都有独立的系统用户负责,运行,进而控制被破坏的范围, 3. ...
- Kafka 推荐网站
Kafka系列文章 [Kafka设计解析(一)- Kafka背景及架构介绍](http://www.jasongj.com/2015/03/10/KafkaColumn1/) [Kafka设计解析(二 ...
- Vue中异步组件(结合webpack,转载)
转载,原文出处:https://www.jianshu.com/p/40a364b5e964 1.什么是异步组件? 异步组件就是定义的时候什么都不做,只在组件需要渲染(组件第一次显示)的时候进行加载渲 ...
- SST-超级简单任务调度器结构分析
SST(Super Simple Task) 是一个基于任务优先级.抢占式.事件驱动.RTC.单堆栈的超级简单任务调度器,它基于Rober Ward一篇论文的思想,Miro Samek用C重新编程实现 ...
- Python学习5——基本格式化输出
整数的格式化输出 十进制.八进制.十六进制 num01 = 100 print("十进制输出:%d"%num01) print("八进制输出:%o"%num01 ...
- C# set 跟 get
可以在类里面 private string name; public string Name { get { return name; } set { name = value; } }
- jquery table 发送两次请求 解惑
版本1.10 以下链接为一个较低版本解决方案: http://blog.csdn.net/anmo/article/details/17083125 而我的情况有点作, 情况描述: 1,一个页面两个t ...
- 天津Uber优步司机奖励政策(1月4日~1月10日)
滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...
- 2 引用 深copy 浅copy
1. is == 总结 is 是比较两个引用是否指向了同一个对象(引用比较). == 是比较两个对象是否相等. In [1]: a = [11,22,33] In [2]: b = [11,22,33 ...