# [Code Vs 2152]滑雪

1 2 3 4 5

16 17 18 19 6

15 24 25 20 7

14 23 22 21 8

13 12 11 10 9

5 5
1 2 3 4 5
16 17 18 19 6
15 24 25 20 7
14 23 22 21 8
13 12 11 10 9

25

## 题解

4个方向扫2(N,M)max$2*(N,M)_{max}$

var
x,y,dp,w:array[-1..100,-1..100]of longint;
i,j,k:longint;
n,m,ans,tt:longint;
function max(a,b:longint):longint;
begin
if a>b
then exit(a)
else exit(b);
end;

procedure work;
var i,j:longint;
begin
for i:=1 to n do
for j:=1 to m do
if w[i,j]>w[i-1,j]
then x[i,j]:=max(x[i,j],x[i-1,j]+1);
for i:=1 to n do
for j:=m downto 1 do
if w[i,j]>w[i+1,j]
then x[i,j]:=max(x[i,j],x[i+1,j]+1);
for i:=1 to n do
for j:=1 to m do
if w[i,j]>w[i,j-1]
then x[i,j]:=max(x[i,j],x[i,j-1]+1);
for i:=1 to n do
for j:=m downto 1 do
if w[i,j]>w[i,j+1]
then x[i,j]:=max(x[i,j],x[i,j+1]+1);
end;

begin
for i:=1 to n do
begin
for j:=1 to m do
end;
for i:=1 to n do
for j:=1 to m do
x[i,j]:=1;
tt:=max(n,m);
for i:=1 to 2*tt do
work;
for i:=1 to n do
for j:=1 to m do
ans:=max(ans,x[i,j]);
writeln(ans);
end.

#### POJ 1088 滑雪（记忆化搜索）

2017-08-12 20:01:22

#### 经典DP题目-滑雪问题

2015-04-01 22:21:50

#### POJ 1088 滑雪 （二维最长上升子序列）

2015-03-20 23:09:48

#### 滑雪（百练1088）

2017-07-26 18:30:10

#### 洛谷 1434 滑雪

2018-01-06 20:00:27

#### codevs 2152 滑雪

2016-03-26 08:10:54

#### silverlight 2104 错误

2012-02-21 15:59:07

#### Codevs 2152 滑雪

2017-07-20 13:32:26

#### 【codevs 2152】滑雪

2017-07-20 14:15:40

#### Silverlight 在ie8 下 报2152 错误

2013-08-12 14:52:56