Strange Operation (strangeoperation)

3 teams scored 57 points on this task, for a maximum score of 23, an average score of 19 and a median score of 23.

Highlights

  1. Banfi, Vimercate is the institute with the most points (23).
  2. Lombardia is the region with the most points (46).

Statement

Doctor Strange found two integer arrays of length N, namely A_0, …, A_N-1 and B_0, …, B_N-1. He can perform the following operation on A any number of times: (1) Choose an index 1 ≤ i ≤ N - 2 and let A_i := -(A_i - 1 + A_i + A_i + 1). That is, assign the value -(A_i - 1 + A_i + A_i + 1) to A_i. Help the Doctor determine whether it is possible to make the array A equal to B and if so, then find the minimum number of operations required to achieve this.