Here is the editorial for the problem 'Total Diamonds' for this month's Codechef long challenge. We use Dynamic Programming and prefix sums to solve the problem.
Prefix sums are precomputed to help answer range queries efficiently.
Problem Statement:
https://www.codechef.com/DEC17/problems/VK18
Solution Code:
https://www.codechef.com/viewsolution/16571159
Prefix Sums:
http://www.geeksforgeeks.org/prefix-sum-array-implementation-applications-competitive-programming/
https://www.hackerrank.com/topics/prefix-sum/
Download
0 formats
No download links available.
Codechef DEC17 - Total Diamonds - Dynamic Programming | NatokHD