Given an array of integers A and k queries. Each query will be like that: 1.Reverse an segment from l to r. 2.Output the sum of integers from l to r. N<=10^5,k<=10^4. Can this problem solved by using segment trees. How?
Given an array of integers A and k queries. Each query will be like that: 1.Reverse an segment from l to r. 2.Output the sum of integers from l to r. N<=10^5,k<=10^4. Can this problem solved by using segment trees. How?
Can you give me link of this problem?
http://olympiads.kz/files/kz-2012-republic-statements.zip. Problem G
Can be solved with a treap with implicit key... read this post http://habrahabr.ru/post/101818/