Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created February 12, 2018 09:10
Show Gist options
  • Select an option

  • Save deque-blog/83f46fe7bf75702b0d595031028f88ae to your computer and use it in GitHub Desktop.

Select an option

Save deque-blog/83f46fe7bf75702b0d595031028f88ae to your computer and use it in GitHub Desktop.
int best_quadrant(Matrix const& m)
{
int n = m.size() / 2;
return accumulate(range(0, n) * range(0, n), 0, [&](int sum, Coord const& coord){
auto flips = symetric_values(m, n, coord);
return sum + *std::max_element(flips.begin(), flips.end());
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment