Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int f(int s, int h, int tc, int b, int w) {
- System.out.println(tc + " s:" + s + " h:" + h);
- if (s == 0 || h == 0)
- return tc;
- int hc = colors[colors.length - h];
- if(hc == 1)
- return Math.min(f(s,h-1,tc,b+1,w), f(s-1,h,tc+(b*w),0,0));
- else
- return Math.min(f(s,h-1,tc,b,w+1), f(s-1,h,tc+(b*w),0,0));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement