vj1159 &aring;&sup2;&sup3;&eacute;&ordm;“&aring;&plusmn;&plusmn;&auml;&cedil;Š&aelig;‰“&aelig;&deg;&

# Vj1159 å²³éº“å±±ä¸Šæ‰“æ°&

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

//±ÉÈËµÄ·½·¨ //ÎÞÏÞ±³°ü //f[j]=min(f[j-k*a[i]]+1) //¼ÇÂ¼×îÐ¡Â·¾¶Ê± ±È½ÏºÃµÄ´¦Àí·½·¨ÊÇÏÈ°ÑË®Í°°´Ìå»ý½µÐòÅÅÁÐ ÕâÑùÒ»¸öÂ·¾¶¾ÍÊÇ°´Ë®Í °Ìå»ý½µÐòÅÅÁÐµÄ ¾Í¿ÉÒÔµ¹×ÅÅÐ¶Ï×îÐ¡Â·¾¶ÁË Í¬Ê±Êä³öÒ²·½±ãÁË ° const maxn=100; maxv=20000; var n,v:integer; a:array[0. .maxn] of integer; f,path,node:array[0. .maxv] of integer; procedure init; var i:integer; begin readln(v); readln(n); for i:=1 to n do readln(a[i]); end; function check(x,y:integer):boolean; begin while x>0 do begin if node[x]<node[y] then exit(true); if node[x]>node[y] then exit(false);

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.

## 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

Vj1159 å²³éº“å±±ä¸Šæ‰“æ°&

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

View Full Document
Ask a homework question - tutors are online