vj1322 解题

vj1322 解题 - / /DP / f[

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

View Full Document Right Arrow Icon
//±ÉÈ˵ķ½·¨ //DP //Éè f[ i , j ] Ϊǰ i µÀÌâ ×îºóÒ»¸öÔÂ×ö j µÀµÄ×îÉÙÔÂÊý //f[ i , j ] = min( f[ i-j , k ] + 1 ) ( 0<=j<=i-j 0<=k<=i-j ) //ÕâʱעÒâµ½ Èç¹û j=0 ÄÇô f[ i-j , k ] µ÷ÓõĻ¹ÊÇÇ° i ÌâµÄ״̬ ²¢ÇÒÎÒÃÇû¼ÆËã //ËùÒÔ¿ÉÒÔÑ¡Ôñ j ²ãµ¹×ÅÑ»· »òÕß j ²ã´Ó 1 ¿ªÊ¼Ñ»· ×îºóÔÙµ¥¶ÀËãһϱ¾ÔÂ×ö 0 ÌâµÄÇé¿ö //Èç¹û j ²ã˳×ÅÑ»· ÄÇô±¾ÔÂ×öÌâÊǵ¥µ÷µÄ Èç¹ûÇ®²»¹»¾Í¿ÉÒÔ break //¶øÈç¹ûµ¹×ÅÑ»· ÄÇôǮ²»¹»Òª continue » //±ÉÈ˵ÄÎÊÌâ //×¢Òâ¼ì²é·½³Ì±ß½çµ÷ÓÃÇé¿ö //×¢Òâ¸ÄÑ»·Ë³Ðòºó continue ºÍ break ÊDz»ÊÇÒ²Òª¸Ä » const maxn=300; var n,m,ans:integer; a,b:array[0. .maxn] of longint;
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

vj1322 解题 - / /DP / f[

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