Plz. Help with this problem.

Правка en1, от LOVELY_BOY_, 2021-08-20 04:56:30

This is the problem asked in ICPC Kanpur-Mathura Regionals yesterday.**How to solve this problem.** **Problem Statement- ** You have an array A (1-indexed) of N integers. You can perform any number of operations on this array. An operation goes like this,

(1) You pick an index i such that 1 ≤ i ≤ n-2 and a[i] + a[i+2] > ai+1 Then you swap a[i] and a[i+2]

You have to output if you can sort the array in non-decreasing order after performing any number of operations. Constraints 1 ≤ T ≤ 105 1 ≤ N ≤ 105 1 ≤ Sum of N over all testcases ≤ 105 1 ≤ Ai ≤ 109

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский LOVELY_BOY_ 2021-08-20 05:02:08 6
en2 Английский LOVELY_BOY_ 2021-08-20 04:59:56 68
en1 Английский LOVELY_BOY_ 2021-08-20 04:56:30 611 Initial revision (published)