vj1428 贪婪格尔曼

Vj1428 贪婪格尔曼

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

View Full Document Right Arrow Icon
//±ÉÈ˵ķ½·¨ //DP //Éè f[j,k] Ϊ·Ö±ðÖÁÉٽРj , kµÄ×îС»¨·Ñ //f[j,k]=min(f[j-a[i],k-b[i]]+c[i] << 1) //ÒòΪ¹æ¶¨µÄÊÇÖÁÉÙ½ÐÉù ËùÒÔµ±a[i] | b[i] ´óÓÚ j | kʱ ÈÃËûÃǵÈÓÚ j | k / //±ÉÈ˵ÄÎÊÌâ //±³°üÓÃÁ˹ö¶¯Çмǵ¹×ÅÑ»· » const maxm=50; maxn=1000; var n,p,q:integer; ans:int64; a,b,c:array[0. .maxn] of longint; f:array[0. .maxm,0. .maxm] of int64; function min(x,y:int64):int64; begin if x<=y then exit(x) else exit(y); end; procedure init;
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

Vj1428 &egrave;&acute;&ordf;&aring;&copy;&ordf;&aelig;&nbsp;&frac14;&aring;&deg;”&aelig;›&frac14;

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