vj1139 &aring;&deg;&egrave;ƒ–&aring;Šž&egrave;&macr;

# Vj1139 å°èƒ–åŠžè¯

This preview shows pages 1–2. Sign up to view the full content.

//±ÉÈËµÄ·½·¨ //dp //ÏÈÊÇÉÏÏÂ¼Ì³Ð È»ºóÍ¬²ãË«Ïòdp / const maxm=100; maxn=500; var m,n,minj:integer; g:array[0. .maxm,0. .maxn] of longint; pre:array[0. .maxn,0. .maxn] of integer; f:array[0. .maxn] of int64; procedure init; var i,j:integer; begin readln(m,n); for i:=1 to m do for j:=1 to n do read(g[i,j]); end; procedure main; var i,j:integer; begin for i:=1 to n do f[i]:=g[1,i]; for i:=2 to m do begin for j:=1 to n do begin f[j]:=f[j]+g[i,j]; pre[i,j]:=j; end; for j:=2 to n do if f[j-1]+g[i,j]<f[j] then begin

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/21/2011 for the course CS 001 taught by Professor 001 during the Spring '11 term at Shandong University.

### Page1 / 2

Vj1139 å°èƒ–åŠžè¯

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online