anurag_orz's blog

By anurag_orz, history, 4 months ago, In English

Given an array A of length N, perform Q queries of 2 types in it
Query 1 — L R given, flip signs of array elements (positive to negetive and vice versa) from L to R
Query 2 — L R given, print index of first negetive element in L to R
Constraints —
N,Q <=2 * 10 ^ 5
-1e8 <= A[i] <= 1e8
Sorry for poor English

Full text and comments »

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