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 ...
随机推荐
- css尖角
.market-nav-arrow { ; ; ; border-style: solid; border-width: 7px 0px 7px 7px; border-color: transpar ...
- 微信之Android各版本列表
微信在不断地更新迭代,ios微信下载点击这里立即开始(手机电脑都可以,电脑端要安装iTunes),每个版本都放出一些新的功能或修复相关错误,详情可以点击下面的版本链接进行查看.(这里有Android微 ...
- JavaScript之图片轮换
<!doctype html> <title>javascript图片轮换</title> <meta charset="utf-8"/& ...
- 使用TreeView+ListBox+TxtBox 资料管理器
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- Git sparse checkout
Git的sparse checkout在clone项目仓库时只clone指定路径下的信息. 步骤如下: (1) mkdir yourdir(2) cd yourdir(3) git init(4) g ...
- KSImageNamed-Xcode插件在xcode 6.4/6.3或其他版本中不能使用解决方案
大家都知道这个插件很强大,但是现在这个插件最新版貌似只支持xcode7 ,需要修改KSImageNamed-xcode中的一个配置文件,添加uuid才能使他支持xcode6.3或6.4 进入下载的插件 ...
- CoreAnimation 核心动画二 锚点
锚点: anchorPoint 以锚点为中心 执行动画 (与 渔夫固定船的点时一致的) anchorPoint 默认是 0.5,0.5 (注意: 锚点 是一个比例) anchorPoint ...
- OC4_内存管理法则
// // Dog.h // OC4_内存管理法则 // // Created by zhangxueming on 15/6/18. // Copyright (c) 2015年 zhangxuem ...
- C# @符号的多种使用方法
1.限定字符串用 @ 符号加在字符串前面表示其中的转义字符“不”被处理.如果我们写一个文件的路径,例如"D:/文本文件"路径下的text.txt文件,不加@符号的话写法如下:str ...
- 终端命令收集(关于 mac与ubuntu)
本人曾使用ubuntu 是踩过有一些坑,以及在处理问题时学到的知识,总结一下,便于以后记忆. 1 基本命令 (1)列出文件 ls 参数 目录名 参数 -w 显示中文,-l 详细信息, -a 包括隐藏文 ...