for(j=0;j<=K;j++) m[0][j] = 0
m[0][0] = 1

for(i=0; i< size(arr); i++){
    for(j=arr[i]; j<=K;j++) m[i+1][j] = m[i][j-arr[i]]
}

Wladimir Araujo Tavares
http://www.si.ufc.br/~wladimir <http://www.si.ufc.br/%7Ewladimir/>
"Fiz uma faculdade! Só não fiz a segunda porque acabaram os tijolos."

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to