Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

Interesting and hard OA quesn

Правка en1, от Titan_2003, 2024-07-31 21:43:42

Problem: Minimum Sum of Absolute Differences in Subsequences

Description:

Given an array of length N (where 1≤N≤1e5) and an integer k (where 1≤k≤50), find the minimum possible value of the sum of absolute differences of adjacent elements for all subsequences of length k.

Mathematically, for a subsequence {ai1,ai2,…,aik} where i1<i2<…<iki1​<i2​<…<ik​, we need to minimize the value of:

$$$\sum_{j=1}^k |a_{i} - a_{i-1}|$$$

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Titan_2003 2024-07-31 21:43:42 464 Initial revision (published)