Educational Codeforces Round 5 B
Problem B:http://codeforces.com/contest/616/problem/B
B. Dinner with Emma
题意:一对夫妻要去餐厅吃晚饭,Emma 想去最豪华(贵)的地方吃,Jack想去最朴素(便宜)的地方吃,于是两人用这个方法决定去哪吃:每个街道和大道的交叉口上有一个餐厅,给出n街道m大道,所以每一条街道上有m个餐厅,由Emma选街道,由Jack选餐馆,(反正Jack会选择Emma选的街道中最便宜的一家)输出最终决定去的餐馆价格。
思路:既然Jack要选最小的但Emma想选大的,取决于Emma,所以找出每组中最小的,从最小的里面找出最大的。
#include<stdio.h>
int main(){
int a,b,i,j,min,max,t[],m[][];
scanf("%d%d",&a,&b);
for(i=;i<a;i++)
for(j=;j<b;j++)
scanf("%d",&m[i][j]);
for(i=;i<a;i++){
min=m[i][];
for(j=;j<b;j++){
if(m[i][j]<=min)
t[i]=min=m[i][j];
}
}
max=t[];
for(i=;i<a;i++){
if(t[i]>max)
max=t[i];
}
printf("%d\n",max);
return ;
}
Educational Codeforces Round 5 B的更多相关文章
- [Educational Codeforces Round 16]E. Generate a String
[Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file f ...
- [Educational Codeforces Round 16]D. Two Arithmetic Progressions
[Educational Codeforces Round 16]D. Two Arithmetic Progressions 试题描述 You are given two arithmetic pr ...
- [Educational Codeforces Round 16]C. Magic Odd Square
[Educational Codeforces Round 16]C. Magic Odd Square 试题描述 Find an n × n matrix with different number ...
- [Educational Codeforces Round 16]B. Optimal Point on a Line
[Educational Codeforces Round 16]B. Optimal Point on a Line 试题描述 You are given n points on a line wi ...
- [Educational Codeforces Round 16]A. King Moves
[Educational Codeforces Round 16]A. King Moves 试题描述 The only king stands on the standard chess board ...
- Educational Codeforces Round 6 C. Pearls in a Row
Educational Codeforces Round 6 C. Pearls in a Row 题意:一个3e5范围的序列:要你分成最多数量的子序列,其中子序列必须是只有两个数相同, 其余的数只能 ...
- Educational Codeforces Round 9
Educational Codeforces Round 9 Longest Subsequence 题目描述:给出一个序列,从中抽出若干个数,使它们的公倍数小于等于\(m\),问最多能抽出多少个数, ...
- Educational Codeforces Round 37
Educational Codeforces Round 37 这场有点炸,题目比较水,但只做了3题QAQ.还是实力不够啊! 写下题解算了--(写的比较粗糙,细节或者bug可以私聊2333) A. W ...
- Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship
Problem Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec P ...
- Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems(动态规划+矩阵快速幂)
Problem Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec P ...
随机推荐
- 关于easyui的一些小知识点(1)
让layout布局自动适应浏览器宽度只需要加上fit="true"属性.
- knowlege experience
The konwledge is you need learning some basic knowledge. The experience is you can use konwledge ma ...
- Excel数据生成Sql语句的方法
选中想要生成的列,套用表格格式,选中表包含标题的选项确定,然后在最右边的一列第二行处,点击函数功能,选择CONCATENATE,在文本里输入想要的结构即可 代码如下 复制代码 ,=CONCATENA ...
- java 调用bash shell脚本阻塞的小问题的解决
java 调用bash shell脚本阻塞的小问题的解决 背景 使用java实现的web端,web端相应用户的界面操作,使用java调用bash实现的shell脚本进行实际的操作,操作完成返回执行结 ...
- JSON解析例子
//解析的东西是数组就用数组接受,是字典就用字典接受 //my.h#ifndef __1_Header_h#define __1_Header_h#define DEBUG 1#define aa 1 ...
- c# 远程回收IIS应用池
利用下列代码可实现IIS应用池的远程回收 var serverManager = ServerManager.OpenRemote(ip); var appPools = serverManager. ...
- 移动web屏幕适配方案
刚进部门就被拉去趟移动端Web的浑水,视觉稿是按照640px设计的.那如何做屏幕适配呢?当然想到的第一方法就是问前辈了,问他们之前怎么做的,前辈说直接按视觉稿来,我说640太大了,他说除以2啊,按32 ...
- Apache 安装与配置
安装Apache 1.下载apache软件http://www.apache.org 2.安装 以管理员身份进行安装 3.设置主机名与域名 4.选择安装类型 5.自定义安装路径 6.开始安装 7.安装 ...
- 【原】GO 语言常见错误
1. Scan error on column index 4: converting string "" to a int: strconv.ParseInt: parsing ...
- 怎样把SEL放进NSArray里
我的技术博客经常被流氓网站恶意爬取转载.请移步原文:http://www.cnblogs.com/hamhog/p/3805270.html,享受整齐的排版.有效的链接.正确的代码缩进.更好的阅读体验 ...