Question about variation of Codeforces Global Round 9 C problem

Правка en1, от Kneee, 2022-10-10 10:28:24

Question

in this 1375C - Уничтожение элементов problem, if he gave me an array, not Permutation, the answer will change or it will be the same thing.

My submission: 175308852

My Idea

My observation is the answer doesn't rely on any element except the first and last one in the array. so, I asked something "If there are multiple numbers of $$$A_1$$$ or $$$A_n$$$, Will something happen?"

My answer is "I don't think so", as if I can erase $$$A_i$$$ $$$(1 \le i \le n)$$$ so I can erase all duplicates of $$$A_i$$$.

Can you ensure that this is correct? or proof it?

Теги data structures, constructive algorithms, greedy

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Kneee 2022-10-10 10:28:24 634 Initial revision (published)