Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

thaonguyendethuongvai's blog

By thaonguyendethuongvai, history, 9 days 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, 2 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 »