- Time: 2016-04-16-20:26:11 Saturday
- Title Number: [2016-04-16][ural][2069][hard Rock]
- Topic: Given a n*m lattice, each side of the lattice with a certain weight, peers or the same column of the Benquan value, ask from the top left to the bottom right corner of all the path, the minimum edge weight of what is the maximum?
- Analysis:
- For the starting point, either sideways or vertically, for the end, either sideways or vertically, so all the paths
- For 1, 22 paths It is clear that the minimum value of the direct right to edge
- For the path of the 3,4
- First both sides of the road are certain, the middle road is uncertain,
- Optimal situation, the middle of the path only need to select from the top to the bottom, the edge of the most important side can be, because if the halfway through the other vertical direction, the edge of the right can only be smaller
- All in all, the answer is 4 cases of maximum ear value.
- Problems encountered:
- Just start to see the topic, Direct Dijkstra, write the number of points found there ten 5 x ten 5 5 x 5 One, and then hehe,
#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn = 1E5 + 10;
int a[maxn],b[maxn];
int main(){
int n,m;
scanf("%d%d",&n,&m);
int aa =0,bb = 0;
for(int i = 0 ; i < n ; ++i){
scanf("%d",&a[i]);
aa = max(aa, a[i]);
}
for(int j = 0 ; j < m ; ++j){
scanf("%d",&b[j]);
bb = max(bb,b[j]);
}
int = min ( min ( b [ 0 " b Span class= "pun" >[ m - 1 aa
int = min ( min ( a [ 0 ", a [ n - 1 ), bb
int = min ( a [ 0 ], b [ m - Span class= "lit" >1
int = min ( b [ 0 ], a [ n - Span class= "lit" >1
printf("%d\n",max(t1,max(t2,max(t3,t4))));
return 0;
}
From for notes (Wiz)
[2016-04-16][ural][2069][hard Rock]