vj1139 小胖办证

Vj1139 小胖办证

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

View Full Document Right Arrow Icon
//±ÉÈ˵ķ½·¨ //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
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
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 Right Arrow Icon
Ask a homework question - tutors are online