Hard Rock
Input
Output
Example
input | output |
---|---|
|
|
|
|
解题思路:
题意:求从左上角刀右下角所经过街道的最小的权值,直接分成4种情况:不好描述,直接看代码:
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int m,n,i,a[],b[];
- cin>>m>>n;
- int maxn = -,maxm = -;
- for(i=;i<m;i++){
- cin>>a[i];
- if(a[i]>maxn&&i!=m-&&i!=)
- maxn = a[i];
- }
- for(i=;i<n;i++){
- cin>>b[i];
- if(b[i]>maxm&&i!=n-&&i!=) maxm = b[i];
- }
- int min1 = min(b[],a[m-]);
- int min2 = min(a[],b[n-]);
- int min3 = min(a[],min(maxm,a[m-]));
- int min4 = min(b[],min(maxn,b[n-]));
- //cout<<min1<<min2<<min3<<min4<<endl;
- int ans = max(max(min1,min2),max(min3,min4));
- cout<<ans<<endl;
- return ;
- }
Hard Rock的更多相关文章
- ural 2069. Hard Rock
2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock ...
- POJ - 2339 Rock, Scissors, Paper
初看题目时就发了个错误,我因为没有耐心看题而不了解题目本身的意思,找不到做题的突破口,即使看了一些题解,还是没有想到方法. 后来在去问安叔,安叔一语道破天机,问我有没有搞清题目的意思,我才恍然大悟,做 ...
- ROCK 聚类算法
ROCK (RObust Clustering using linKs) 聚类算法是一种鲁棒的用于分类属性的聚类算法.该算法属于凝聚型的层次聚类算法.之所以鲁棒是因为在确认两对象(样本点/簇)之间 ...
- Rice Rock
先翻译评分要点,然后一点点翻译程序实现过程 如何产生一堆岩石? rock_group = set([])#空集合,全局变量 rock_group.add(a_rock) 要画出来draw hand ...
- HDOJ(HDU) 2164 Rock, Paper, or Scissors?
Problem Description Rock, Paper, Scissors is a two player game, where each player simultaneously cho ...
- The Rock Game
Before the cows head home for rest and recreation, Farmer John wantsthem to get some intellectual st ...
- 弹指之间 -- Folk Rock
CHAPTER 17 民谣摇滚 Folk Rock 以8Beat为主,120左右的速度最能表现此节奏特色. 示例曲目: 略
- 2018 ACM-ICPC 中国大学生程序设计竞赛线上赛 H题 Rock Paper Scissors Lizard Spock.(FFT字符串匹配)
2018 ACM-ICPC 中国大学生程序设计竞赛线上赛:https://www.jisuanke.com/contest/1227 题目链接:https://nanti.jisuanke.com/t ...
- HDU 2164 Rock, Paper, or Scissors?
http://acm.hdu.edu.cn/showproblem.php?pid=2164 Problem Description Rock, Paper, Scissors is a two pl ...
随机推荐
- [03] mapper.xml的基本元素概述
1.select 我们基于这个持久层接口 GirlDao: public interface GirlDao { List<Girl> findByAge(int age); Girl f ...
- Multiple Threads reading from the same file(转载)
问 I have a xml file that needs to be read from many many times. I am trying to use the Parallel.ForE ...
- Luogu3959 NOIP2017 宝藏 状压DP
题目传送门:https://www.luogu.org/problemnew/show/P3959 题意:给出一个有$N$个点的图,求其中的一个生成树(指定一个点为根),使得$\sum\limits_ ...
- 实现Repeater控件的记录单选
有朋友问及,在Repeater控件中第一列放置一个RadioButton,实现对记录的单选. 下面Insus.NET想举个例子来实现与说明. 为Repeater控件准备数据: 在ASPX网页上,写好R ...
- 扩展 WPF 动画类
原文:扩展 WPF 动画类 扩展 WPF 动画类 Charles ...
- C#路径的八种相关操作,判断字符串是否为路径等
原文:C#路径的八种相关操作,判断字符串是否为路径等 1.判定一个给定的C#路径是否有效,合法 通过Path.GetInvalidPathChars或Path.GetInvalidFileNameCh ...
- Ionic App之国际化(2) json数组的处理
在Ionic App值国际化(1)中我们实现了对单个参数的多语言处理,下面开始如何进行数组的处理. 1.在我们的多语言文件中设置要访问的json数组,en.json和zh.json,此处就以en.js ...
- FSMC的个人理解
个人理解: FSMC相当于外部设备存储器地址在FSMC对应存储地址中的映射,通过在FSMC的存储地址中写数据,就能通过FSMC的地址线和数据线,将地址和数据写到外部设备存储器地址中.所以,程序中,需要 ...
- (一)ABP添加控制器和页面(有时候页面不出来)
1:添加控制器后需要写[Area("AppAreaName")] 2:继承 WebControllerBase 3:创建视图就可以出现index页面了
- 移动端自动化测试-WTF Appium?
手机App分为两大类,原生App(Native App)和混合APP(Hybrid App) 原生App(Native App) 原生App实际就是我们所常见的传统App开发模式,云端数据存储+App ...