Pagini recente » Diferente pentru problema/minperm intre reviziile 3 si 7 | Diferente pentru admin/task-ratings-guidelines intre reviziile 16 si 17 | Atasamentele paginii martian-war | Monitorul de evaluare | Diferente pentru problema/minperm intre reviziile 5 si 7
Nu exista diferente intre titluri.
Diferente intre continut:
h2. Date de intrare
Fişierul de intrare $minperm.in$ ...
The first line of the input file $minperm.in$ contains $n$ and $k$.
The second line of the input contains $n$ integers, representing the initial order of the attractions.
The third line of the input contains $k$ integers, representing the $k$ available swap plans.
h2. Date de ieşire
În fişierul de ieşire $minperm.out$ ...
The only line of the output file $minperm.out$ should contain $n$ elements, representing the best order for showing the attractions.
h2. Restricţii
* $... ≤ ... ≤ ...$
* $1 ≤ k ≤ n ≤ 5000$
* For tests worth $10$ points, $1 ≤ k ≤ n ≤ 8$
* For tests worth $30$ more points, $1 ≤ k ≤ n ≤ 100$
h2. Exemplu
table(example). |_. minperm.in |_. minperm.out |
| This is some
text written on
multiple lines.
| This is another
text written on
multiple lines.
| 8 1
1 4 3 5 7 2 8 6
8
| 1 4 3 5 7 2 8 6
|
h3. Explicaţie
table(example). |_. minperm.in |_. minperm.out |
| 8 7
2 4 1 5 3 6 7 8
7 6 3 8 2 5 1
| 1 2 3 4 5 6 7 8
|
...
== include(page="template/taskfooter" task_id="minperm") ==
Nu exista diferente intre securitate.
Topicul de forum nu a fost schimbat.