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. 该函 ...
随机推荐
- centos7中nginx的搭建
./nginx 启动服务./nginx -s stop 关闭服务./nginx -s reload 重新加载配置文件 首先我们应当安装一个依赖的软件包: yum install gcc-c++yum ...
- jQuery动态绑定事件(左右移动)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- PHP环境配置:Windows7+IIS7+PHP+MySQL - 适用于(2008 R2 / 8 / 10)
配置需求 操作系统:Windows7(x32/x64), windows2008 IIS版本:7.0 PHP版本:7.0.6 及以上 MySQL版本:5.7.12 及以上 第一步:安装 IIS 注意: ...
- centos7下使用n grok编译服务端和客户端穿透内网
(发现博客园会屏蔽一些标题中的关键词,比如ngrok.内网穿透,原因不知,所以改了标题才能正常访问,) 有时候想在自己电脑.路由器或者树莓派上搭建一些web.vpn等服务让自己用,但是自己的电脑一般没 ...
- JavaWeb——升级赛-学生成绩管理系统(2).java---19.01.03
dao.java package Dao; import java.sql.Connection;import java.sql.ResultSet;import java.sql.SQLExcept ...
- 无限滚动HTML UL结构
http://framework7.taobao.org/docs/infinite-scroll.html#.VUjA7NOqqko
- Java集合——ArrayList源码详解
) ArrayList 实现了RandomAccess, Cloneable, java.io.Serializable三个标记接口,表示它自身支持快速随机访问,克隆,序列化. public clas ...
- 全国Uber优步司机奖励政策 (1月18日-1月24日)
本周已经公开奖励整的城市有:北 京.成 都.重 庆.上 海.深 圳.长 沙.佛 山.广 州.苏 州.杭 州.南 京.宁 波.青 岛.天 津.西 安.武 汉.厦 门,可按CTRL+F,搜城市名快速查找. ...
- CakePHP Model中( 获取Session)使用Component的方法
有时候我们需要在Model中使用Session,大家知道CakePHP把操作Session的方法封装为了一个Component, 在Model中正常读取Session的方法: 在 "app_ ...
- JDBC 工具类模板c3p0
JDBC 工具类模板 package com.itheima.sh.utils; import com.mchange.v2.c3p0.ComboPooledDataSource; import ja ...