vj1061 迎春舞会之三ä&ordm

Vj1061 迎春舞会之三ä&ordm

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//±¾ÌâÊý¾Ý¹æÄ£µÃ¿ªµÄ´óÓÚÌâÄ¿ / //±ÉÈ˵ķ½·¨ //dp //´ÓºóÍùÇ° dp ¶ÔÓÚµ¹ÊýµÚ i ¸öÈË¿ÉÒÔÑ¡ÔñËûºÍËûºóÃæµÄÈ˹¹³É j ×é Ò²¿ÉÒÔ²»Ñ¡Ëû¹¹³É j ×é //f[i,j]:=min(f[i-1,j],f[i-2,j-1]+sqr(a[i]-a[i-1])) //ÒòΪºó i ¸öÈË×î¶àÄܹ¹³É (i div 3) ×é ËùÒÔ j ´Ó 1 Ñ»·µ½ (i div 3) //ÕâʱѡµÚ i ºÍµÚ i+1 ¸öÈ˹¹³ÉÒ»×éʱ ÒòΪ·Ç½µÐòÅÅÁÐ ËùÒԱض¨ÄÜ ´ÓºóÃæÕÒµ½Ò»¸ö¿ÕÏеÄÈËÕ¾ i ºÍ i+1 µÄÖÐ¼ä ´ const
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online