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. 该函 ...
随机推荐
- 在JSP中使用formatNumber控制要显示的小数位数
先引入标签库 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 比 ...
- 第3章 jQuery中的DOM操作
parent() .parents().closest() 区别示例: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitiona ...
- 【mongdb主从复制和同步】
主从同步: Master: Slave: 副本集: #在卷本中加任意主机 #登录从 #登录主 #同步日志 #仲裁: 向集群中添加主机成为仲裁 #查看集群里的成员角色参数:
- PHP服务端支持跨域
跨域 由于浏览器的同源策略,导致浏览器页面访问非同源(协议.域名.端口任一不同)服务器产生跨域问题! PHP服务端配置支持跨域: // 指定允许其他域名访问, * 表示全部域名 header('Acc ...
- 分析nginx 日志常用命令
一.概念 并发连接数 客户端向服务器发起请求,并建立了TCP连接.每秒钟服务器链接的总TCP数量,就是并发连接数.请求数 请求数指的是客户端在建立完连接后,向http服务发出GET/POS ...
- 十分钟部署Anemometer作为Mysql慢查询可视化系统
前言 采用Anemometer将Mysql慢查询日志可视化,可以更便捷的查询慢查询日志,并根据时间戳进行历史查询.如下是单机版Anemometer部署的演示,实际应用中,为安全起见,建议把anemom ...
- Android Studio 引入 Git 并提交代码
File -> Settings -> Version Control -> Git -> Path to Git executable -> 选择本地 Git 可执行文 ...
- java操作HDFS
package com.lei.hadoop; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Fil ...
- nginx下pagespeed使用详解
目录 1.简介 2.安装 2.1脚本安装 查看该脚本的如何使用 使用脚本自动安装 替换以前的nginx 2.2 手动安装 先安装基本依赖 构建pagespeed 重新编译安装nginx 3.配置 3. ...
- 转 Cobar使用文档(可用作MySQL大型集群解决方案)
转自:http://blog.csdn.net/shagoo/article/details/8191346 最近好不容易抽空研究了下Cobar,感觉这个产品确实很不错(在文档方面比Amoeba强多了 ...