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. 该函 ...
随机推荐
- 806. Number of Lines To Write String (5月24日)
解答 class Solution { public: vector<int> numberOfLines(vector<int>& widths, string S) ...
- 一个hibernate中的异常:NonUniqueDiscoveredSqlAliasException
在hibernate中用SQL查询返回的结果集中,列名或别名必须唯一,否则会报下面的错误.返回的结果集中,列名或别名可以没有,但只能有一列没有. //空别名重复的情况:org.hibernate.lo ...
- 新手Linux命令学习
一.dd命令:1.可以复制文件,2.可以制作ios镜像,简单理解就是备份 常用的参数 if 设置输入文件的名称 of 设置输出文件的名称 bs 设置每个“”块“”大小 count 要复制“块” ...
- jQuery UI.Layout 参数
applyDefaultStyles: true,//应用默认样式 scrollToBookmarkOnLoad:false,//页加载时滚动到标签 showOverflowOnHover:false ...
- css:url链接去下划线+点击前黑色+点击时灰色+点击后黑色
一般的文章列表 加了样式之后的效果 附上css代码 /*点击前*/ a:link{ color: black; } /*点击后*/ a:visited{ color: black; } /*点击时*/ ...
- webpack安装与使用
webpack: JavaScript 应用程序的静态模块打包器 安装webpack前需要搭建node环境: 1. 安装node.js(https://nodejs.org/en/), 安装完后会自动 ...
- java 整型数据转换为小数类型 BigDecimal 装换为Double
A,B为String类型 ,A-B=C BigDecimal A=(BigDecimal) map.get("A"); BigDecimal B=(BigDecimal) map. ...
- margin中的bug解决方法
margin bug问题 : 当做子元素中使用margin-top: 50px;父子元素都会跑出50px, 解决方法: 在父元素中使用下面三种任意一种都可以. 方法一:给父元素加边框 border: ...
- django的render的特殊用法
以前都是将模板渲染好, 传输到前端, 但是现在前后端分离了, 模板渲染引擎还有用, 而且很好用. 比如在渲染一个表格的时候, 每一行都有两个操作按钮, 并且这个按钮上是有a标签的 你可以使用字符串拼接 ...
- 【 es搜索】
地图搜索实现: ①参数: 左下角经纬度和右上角经纬度 图层数(zoom) 关键字等各种数据库中的字段 排序方式 具体的坐标点+距离 ②实现 a.用es作为关系库,首先先mapping所有的字段,然后用 ...