要求严惩搬题人
查看原帖
要求严惩搬题人
555520
__log__楼主2024/7/13 19:10

md没见过这么垃圾的题面

请管理大大顺便把翻译中所有“置换”替换成“排列”

Latex:

题目描述

You are given a permutation pp of length nn and a positive integer kk.Consider a permutation qq of length nn such that for any integers ii and jj,where 1≤i<j≤n1 \le i < j \le n,we have

pqi≤pqj+k.p_{q_i}\le p_{q_j} + k.

Find the minimum possible number of inversions in a permutation qq.

A permutation is an array consisting of nn distinct integers from 11 to nn in arbitrary order.For example,[2,3,1,5,4][2,3,1,5,4] is a permutation,but [1,2,2][1,2,2] is not a permutation (22 appears twice in the array) and [1,3,4][1,3,4] is also not a permutation (n=3n = 3 but there is 4 in the array).

an inversion in a permutation aa is a pair of indices ii and jj (1≤i,j≤n1 \le i,j \le n) such that i<ji<j,but ai>aja_i > a_j

源代码

## 题目描述

You are given a permutation $p$ of length $n$ and a positive integer $k$.Consider a permutation $q$ of length $n$ such that for any integers $i$ and $j$,where $1 \le i < j \le n$,we have

$$p_{q_i}\le p_{q_j} + k.$$

Find the minimum possible number of inversions in a permutation $q$.

A permutation is an array consisting of $n$ distinct integers from $1$ to $n$ in arbitrary order.For example,$[2,3,1,5,4]$ is a permutation,but $[1,2,2]$ is not a permutation ($2$ appears twice in the array) and $[1,3,4]$ is also not a permutation ($n = 3$ but there is 4 in the array).

an inversion in a permutation $a$ is a pair of indices $i$ and $j$ ($1 \le i,j \le n$) such that $i<j$,but $a_i > a_j$
2024/7/13 19:10
加载中...