请求修复题面
查看原帖
请求修复题面
329672
Ninelife_Cat楼主2021/5/30 09:40

本题的输入格式和题目描述是一样的。

原题的输入格式为:

The first line contains two integers nn and kk (1n,k2000)\left(1\leq n, k \leq 2000\right) — the number of people and the maximal capacity of the elevator.

The next line contains nn integers: f1f_1, f2f_2fnf_n (2fi2000)\left(2\leq f_i\leq 2000 \right),where fif_i denotes the target floor of the i-th person.

The first line contains two integers $n$ and $k$ $\left(1\leq n, k \leq 2000\right)$ — the number of people and the maximal capacity of the elevator.

The next line contains $n$ integers: $f_1$, $f_2$,$…$, $f_n$ $\left(2\leq f_i\leq 2000 \right)$,where $f_i$ denotes the target floor of the i-th person.

顺便补一下翻译:

nn 个人,每个人有一个要去的层数 fif_i

有一个每次能容纳 kk 人的电梯,电梯初始位于 11 层,电梯从 aa 层到 bb 层需要 ab|a-b| 单位的时间。

请求出将所有人运送到对应层数,然后让电梯返回第 11 层的最少时间。

有 $n$ 个人,每个人有一个要去的层数 $f_i$。

有一个每次能容纳 $k$ 人的电梯,电梯初始位于 $1$ 层,电梯从 $a$ 层到 $b$ 层需要 $|a-b|$ 单位的时间。

请求出将所有人运送到对应层数,然后让电梯返回第 $1$ 层的最少时间。
2021/5/30 09:40
加载中...