Rod Cutting Problem Code
Don't using namespace std - especially if you're going to define a max() function in the global namespace (why not just use std::max() anyway?  That's what it's for!).

Where do the values in arr and rodMax come from?  Do their lengths have to agree?  If so, make that obvious in the code (e.g. use std::array, so that we can use arr.size() to count the members).