Codeforces Round #743 (Div.2) B — Swaps

Правка en6, от WaterGroup, 2021-09-19 15:11:49

I think this problem is not very hard and it's interesting.

Description:

You are given $$$2$$$ arrays $$$a$$$ and $$$b$$$ and the length of them is $$$n$$$.

  • $$$1$$$, $$$3$$$, $$$5$$$, ......, $$$2 * n - 1$$$ is in $$$a$$$.

  • $$$2$$$, $$$4$$$, $$$6$$$, ......, $$$2 * n$$$ is in $$$b$$$.

$$$\mathrm{Algorithm}\ 1:$$$

we use the array $$$mp_i$$$ is $$$i$$$ the distance to the $$$a_1$$$ or $$$b_1$$$.

We can enumerate the $$$i$$$ and the $$$j$$$, and the answer is $$

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en8 Английский WaterGroup 2021-09-19 15:21:43 2785
en7 Английский WaterGroup 2021-09-19 15:16:28 2852
en6 Английский WaterGroup 2021-09-19 15:11:49 162
en5 Английский WaterGroup 2021-09-19 15:07:30 14
en4 Английский WaterGroup 2021-09-19 15:06:15 22
en3 Английский WaterGroup 2021-09-19 15:05:46 22
en2 Английский WaterGroup 2021-09-19 15:04:51 79
en1 Английский WaterGroup 2021-09-19 15:04:16 358 Initial revision (published)