vj1126 矩形覆盖

Vj1126 矩形覆盖

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

View Full Document Right Arrow Icon
//±ÉÈ˵ķ½·¨ //DP //³Ë»ý×î´óÄ£ÐÍ //¿ÉÒÔö¾Ùµã ÒÔÕâ¸öµãΪ»ù×¼ºáÏò»ò×ÝÏòÇпªµÃÁ½¸öµã¼¯ s1 , s2 °Ñ s1 ÖеÄÓà 1 ¸ö¾ØÐθ²¸Ç s2 ÖеĵãÓà k-1 ¸ö¾ØÐθ²¸Ç //¿ÉÒÔÏȺáÏòÅÅÐò È»ºóºáÏò dp Ò»´Î ÔÙ×ÝÏòÅÅÐò ×ÝÏò dp Ò»´Î //f[i,j]=min( f[i,j] , f[k,j-1] + area(k+1,i) ) ÒòΪ¾ØÐβ»ÄÜÓб߻ò¶¥µãÖØºÏ ËùÒÔ x[k] or y[k] <> x[k+1] or y[k+1] x const maxk=4; maxn=50; var n,m:integer; g:array[0. .maxn,0. .1] of integer; f:array[0. .maxn,0. .maxk] of longint; low,high:array[0. .maxn,0. .maxn] of integer; procedure swap(var x,y:integer); var t:integer; begin t:=x; x:=y; y:=t; end; function min(x,y:longint):longint; begin if x<=y then exit(x) else exit(y); end; function max(x,y:longint):longint; begin if x>=y then exit(x) else exit(y); end; procedure init; var i:integer; begin readln(n,m);
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.

Page1 / 2

Vj1126 &ccedil;Ÿ&copy;&aring;&frac12;&cent;&egrave;&brvbar;†&ccedil;›–

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