HI,
I have a classic chessboard and rice problem. the detailed statement is in
the link:http://pastebin.com/nykkFP84
my solution is :
1. int max_rice(std::vector<std::vector<int>> const& board, unsigned x,
unsigned y)
2. {
3. if (y == board.size() || x == board[0].size()) return 0;
4.
5. return std::max(max_rice(board, x + 1, y), max_rice(board, x, y + 1))
+ board[y][x];
6. }
I would like to find a dynamic programming solution to this problem. Any
ideas?
thanks,
Sarvesh
--
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.