![]() |
August 2014
[url]http://domino.research.ibm.com/Comm/wwwr_ponder.nsf/challenges/August2014.html[/url]
|
[CODE][SPOILER]cost=vector(100); choice=vector(100);
cost[1]=0; choice[1]=1; for(i=2,100, mcost=10000; mchoice=0; for(ch=1,i-1, ncost=(ch/i)*(1+cost[ch])+((i-ch)/i)*(10+cost[i-ch]); if(ncost < mcost, mcost=ncost; mchoice=ch)); cost[i]=mcost; choice[i]=mchoice)[/SPOILER][/CODE] |
[url]http://domino.research.ibm.com/Comm/wwwr_ponder.nsf/solutions/August2014.html[/url]
|
| All times are UTC. The time now is 00:17. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.