Created
February 12, 2018 09:09
-
-
Save deque-blog/e6b680bb0a345d7ea17967581fbdb50d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int best_quadrant(Matrix const& m) | |
| { | |
| int n = m.size() / 2; | |
| return accumulate(range(0, n), 0, [&](int sum, int i){ | |
| return accumulate(range(0, n), sum, [&](int sum, int j){ | |
| auto flips = symetric_values(m, n, {i, j}); | |
| 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