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的更多相关文章

  1. [Educational Codeforces Round 16]E. Generate a String

    [Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file f ...

  2. [Educational Codeforces Round 16]D. Two Arithmetic Progressions

    [Educational Codeforces Round 16]D. Two Arithmetic Progressions 试题描述 You are given two arithmetic pr ...

  3. [Educational Codeforces Round 16]C. Magic Odd Square

    [Educational Codeforces Round 16]C. Magic Odd Square 试题描述 Find an n × n matrix with different number ...

  4. [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 ...

  5. [Educational Codeforces Round 16]A. King Moves

    [Educational Codeforces Round 16]A. King Moves 试题描述 The only king stands on the standard chess board ...

  6. Educational Codeforces Round 6 C. Pearls in a Row

    Educational Codeforces Round 6 C. Pearls in a Row 题意:一个3e5范围的序列:要你分成最多数量的子序列,其中子序列必须是只有两个数相同, 其余的数只能 ...

  7. Educational Codeforces Round 9

    Educational Codeforces Round 9 Longest Subsequence 题目描述:给出一个序列,从中抽出若干个数,使它们的公倍数小于等于\(m\),问最多能抽出多少个数, ...

  8. Educational Codeforces Round 37

    Educational Codeforces Round 37 这场有点炸,题目比较水,但只做了3题QAQ.还是实力不够啊! 写下题解算了--(写的比较粗糙,细节或者bug可以私聊2333) A. W ...

  9. 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 ...

  10. 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 ...

随机推荐

  1. C#编写windows服务程序

    Windows Service这一块并不复杂,但是注意事项太多了,网上资料也很凌乱,偶尔自己写也会丢三落四的.所以本文也就产生了,本文不会写复杂的东西,完全以基础应用的需求来写,所以不会对Window ...

  2. HDOJ2029Palindromes _easy version

    Palindromes _easy version Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Jav ...

  3. 人生的抉择—aspx、ashx、asmx文件处理请求效率比较

    人生总是面临着许多抉择许多困惑!作为一名"攻城师"或"程序猿"的我们,工作的时候更是如此.你曾经是否苦恼过在系统中使用哪种文件编写客户端请求最合适或最高效呢?a ...

  4. javascript对象初读

    <script type="text/javascript"> function baseClass() { this.showMsg = function() { a ...

  5. Cocos开发中性能优化工具介绍之Visual Studio内存泄漏检测工具——Visual Leak Detector

    那么在Windows下有什么好的内存泄漏检测工具呢?微软提供Visual Studio开发工具本身没有什么太好的内存泄漏检测功能,我们可以使用第三方工具Visual Leak Detector(以下简 ...

  6. windows搭建virtualbox虚拟机安装的android环境

    1.首先安装virtualbox,从官网下载,安装完成之后在本地连接里面有virtualbox虚拟的网卡,可能会影响网络连接,一般禁用 2.下载android的镜像,完整名称是:android-x86 ...

  7. nodejs7.0 试用 async await

    nodejs 7.0.0 已经支持使用 --harmony-async-await 选项来开启async 和 await功能. 在我看来,yield 和 async-await 都是在特定范围内实现了 ...

  8. bzoj3389:[Usaco2004 Dec]Cleaning Shifts安排值班

    思路:可以贪心,也可以最短路. 贪心写法:因为在保证合法的前提下,我们选择的区间一定要右端点尽量靠后才行,于是我们每次就选择一个合法的并且右端点最靠后的区间就好了(如果没有合法的输出-1即可).时间复 ...

  9. IOCP模型总结(转)

    IOCP模型总结(转) IOCP(I/O Completion Port,I/O完成端口)是性能最好的一种I/O模型.它是应用程序使用线程池处理异步I/O请求的一种机制.在处理多个并发的异步I/O请求 ...

  10. 分类算法之贝叶斯(Bayes)分类器

    摘要:旁听了清华大学王建勇老师的 数据挖掘:理论与算法 的课,讲的还是挺细的,好记性不如烂笔头,在此记录自己的学习内容,方便以后复习.   一:贝叶斯分类器简介 1)贝叶斯分类器是一种基于统计的分类器 ...