2024-04-22から1日間の記事一覧

AtCoder Regular Contest 176 (Sponsored by Mynavi)D - Swap Permutation

問題 D - Swap Permutation 解法 問題を少し変更して $\displaystyle \sum _ {i = 0} ^ {N - 1} |P _ i - P _ {i + 1}|$ の総和を求める問題を考えます。ここで、$P _ 0 = P _ N$ とします (つまり円環上で隣接している項の差分の絶対値の和)。 元の $P$ に…