yes…now i get the error.
so you calculated min and max but keeping them in cyclic order and then checking max for each element one by one as per formula |x-y|*i and finally calculated the maximum result.
am i right?
yes…now i get the error.
so you calculated min and max but keeping them in cyclic order and then checking max for each element one by one as per formula |x-y|*i and finally calculated the maximum result.
am i right?
Well, that’s the general idea.
Don’t call me sir… mate. I passed my 12th this year!!!
Well, talking about tutorials, first refer basic data structures like arrays, vector, map, set, Stack, Queue. Articles on geeksforgeeks and tutorialspoint are very helpful. Then work on various techniques like dp, graph, string processing, combinatorics and many more. There’s no end to it. PRACTICE is the key…
After basic data structures, refer following link for competitive programming…
https://discuss.codechef.com/questions/48877/data-structures-and-algorithms