CommonLounge is a community of learners who learn together. Get started with the featured resources above, ask questions and discuss related stuff with everyone.
'Almost every solution you can do with Segment Tree can also be done with Binary Index Trees.' Its true the other way round because BIT only supports sum queries
I got selection to IOITC this year. I would like to know more about the camp and topics which will be discussed there. Will they teach the whole syllabus of IOI in the camp within a span 10 days? What all should I learn before attending the camp in order to understand everything discussed there in a more better way?
This seems to be quite an interesting problem from IOITC 2013.
Problem in Short: You are given N distinct points on a plane where distances are measured using the Manhattan metric. Find the number of ordered triplets of distinct points (A;B;C) such that the sum of distances from A to B and B to C is equal to the distance from A to C.
I have been trying this problem for quite some time but unable to come up with a solution to pass the following constraints: N<=10^5 and |xi|<=10^9 , |yi|<=10^9.
Some hints to get me unstuck would be highly appreciated. Thank you.
This seems like a very good problem unfortunately my mind has been unable to make much progress. Therefore hints would be very appreciated :D. Here is the problem:
Today, we have a very interesting problem for you. Given an array A of N integers indexed from 1 to N, you need to perform following two types of queries :
• Change the value of A[x] to k.
• Find the kth ranked element in the subarray A[x..y] (x and y inclusive). An element is said to have kth rank if its position is k when the subarray is sorted in ascending order.