thaonguyendethuongvai's blog

By thaonguyendethuongvai, history, 3 weeks ago, In English

Hi Codeforces! Problems : https://dmoj.ca/problem/ioi02p4 I read the editorial and their definition of dp[i] = dp[j] + ( S + sum( t[k] ) ) * sum( f[k] ) with j < k <= i but the statement tell that to calculate batch i, our euquation is dp[i] = dp[j] + ( t + S + sum( t[k] ) ) * sum( f[k] ) with j < k <= i and t is the time needed to solve the previous batches. Can somebody explain it? I would be extremely grateful.

Full text and comments »

By thaonguyendethuongvai, history, 4 weeks ago, In English

Hi Codeforces! I wonder that is there any data structure or some implementation of segment tree that has a ability to solve the following operation : - Totally delete an element from the initial array. - Query the maximum / minimum / sum / ... in a range. Example : Initial array : 1 2 3 4 5 - Query for the sum of the range [ 1, 3 ] : 1 + 2 + 3 = 6. - Deleting 1 from the array Now the array is : 2 3 4 5 - Query for the sum of the range [ 1, 3 ] : 2 + 3 + 4 = 9. I 'm just a newbie in cp, sorry for my bad english. Thanks in advance!

Full text and comments »

By thaonguyendethuongvai, history, 5 weeks ago, In English

my solution and the AC solution both use unordered_set and the same way in bfs my sol : https://ideone.com/yKneg6 AC sol : https://ideone.com/3TBB8n thanks in advance!

Full text and comments »