BarkovBG's blog

By BarkovBG, history, 5 years ago, translation, In English

Hello! I am trying to solve the problem — 1349B - Orac and Medians And the solution from editorial answer "yes" in this test case:

1
7 3 
5 0 5 1 1 1 3

I don't understand why... Can you help me, please?

  • Vote: I like it
  • +6
  • Vote: I do not like it

»
5 years ago, # |
Rev. 2   Vote: I like it +21 Vote: I do not like it

array: 5 0 5 1 1 1 3

 apply(1, 3)

array: 5 5 5 1 1 1 3

 apply(1, 5)

array: 5 5 5 5 5 1 3

 apply(5, 7)

array: 5 5 5 5 3 3 3

 apply(2, 7)

array: 5 3 3 3 3 3 3

 apply(1, 2)

array: 3 3 3 3 3 3 3