vj1063 &egrave;&iquest;Ž&aelig;˜&yen;&egrave;ˆž&auml;&frac14;š&auml;&sup1;‹&eacute;›†&auml;&frac12;“

# Vj1063 &egrave;&iquest;Ž&aelig;˜&yen;&egrave;ˆž&auml;&frac14;š&auml;&sup1;‹&eacute;›†&auml;&frac12;“

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

//±¾ÌâÊý¾Ý¹æÄ£´íÎó / //±ÉÈËµÄ·½·¨ //dp //Èý½ÇÐÎÓÐÁ½ÖÖÇé¿ö //¼â³¯ÏÂ£ºf[i,j]:=min(f[i-1,j],f[i-1,j+2])+1 //¼â³¯ÉÏ£ºf[i,j]:=min(f[i+1,j-2],f[i+1,j])+1 / //±ÉÈËµÄÎÊÌâ //¾ÐÄàÓÚ×î´óÕý·½ÐÎµÄ×ö·¨ ÕÒ×óÐ±µÄ×î´óÈý½ÇÐÎºÍÓÒÐ±µÄ×î³¤±ßµÄÐ¡Õß //ÆäÊµÕÒ×óÐ±ºÍÓÒÐ±×î´óÈý½ÇÐÎµÄÐ¡Õß¼´¿É / const maxn=200; var n,ans:integer; g:array[0. .maxn] of boolean; f:array[0. .maxn] of integer; function min(x,y:integer):integer; begin if x<=y then exit(x); exit(y); end; procedure init; var i,j:integer; ch:char; begin readln(n); for i:=1 to n do begin for j:=1 to i-1 do read(ch); for j:=1 to (n-i+1) << 1 -1 do 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.

## Vj1063 &egrave;&iquest;Ž&aelig;˜&yen;&egrave;ˆž&auml;&frac14;š&auml;&sup1;‹&eacute;›†&auml;&frac12;“

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

View Full Document
Ask a homework question - tutors are online