Comments
0

For each $$$i$$$ from permutation it can contribute to sum with $$$1$$$ or $$$-1$$$. Same for $$$i$$$ from neutral permutation. There are exactly $$$n$$$ numbers that contribute with $$$1$$$ and $$$n$$$ with $$$-1$$$. It's easy to see that maximal sum is achieved when $$$n$$$ greatest numbers contribute with $$$1$$$ and $$$n$$$ smallest with $$$-1$$$. Also you can see that with permutation $$$[n, n - 1, n - 2, ..., 1]$$$ we get this sum.

On hmmmmm → Hamiltonian of random graphs, 2 years ago
0

What about finding longest non-self-intersecting path/cycle? Also can you describe this trivial algorithm?

On hmmmmm → Funny sum :), 3 years ago
+29

Got it, thanks

On hmmmmm → Funny sum :), 3 years ago
+29

Can you explain it in more details?

+11

Thanks!

Thanks!

How to solve E?