Nice trick other than using priority queue. BTW there is a neat hack. You can use for (auto [key, val]: a_map) {...} Less cumbersome to fetch out key or value.
@@competitivecoding-newtonsc9601 i didn't understand the problem with this sir. Can't the collisions be handled? and does this mean we have to avoid unordered maps when dealing with large test cases
brother i solved this almost 30 minutes before contest end,but i use sets so got tle then i change the same code in arrays but i did a little mistake not able to find bug but i find the bug and submit 30sec after contest end and it got accepted and now i am pissed rn
@@competitivecoding-newtonsc9601 I know you are not muslim hence I told you read about islam , and i didnt tell you read about religions as there is only one religion, u know nothing comes for granted sahil put in the work , as the first question any human is asked after they die is "What is your religion" and if you answered by anything other than islam the following one is "Then what were you doing " meaning what were you doing being in other religion or being an athiest ? why Didnt you put in the work? why did you put the work in every thing in your life other than searching for your creator and why did he created you although he doesnt need you then why? why all the innocent people that die ?? why ? why there is suffering ?? If all that reduces nothing from his kingdom and all the people that are praying for him increase nothing in his kingdom then why? why there is evil why? Try preparing your answers before it is too late ❤
Never stop this codeforces explanation series. I love your videos.
Thanks, will do!
@@competitivecoding-newtonsc9601 why giving wrong answer for unordered_map
love how you don't go straight into the solution, and instead guide the viewer starting from observations + intuition
Thanks Raymond
With your videos my learning curve will shrink drastically. Thank you.
Thanks Ravi
thnx a lot
✨
Sir, where in the question is it mentioned that we need to go from log(n) base 10 +1 . I didn't get why are we adding 1 to the log value.
Number of digits in a number = log10(num)+1
baap explanation
Thanks Prakhar.
Nice trick other than using priority queue.
BTW there is a neat hack. You can use
for (auto [key, val]: a_map) {...}
Less cumbersome to fetch out key or value.
I use c++14, you can only decompose like this c++17 onwards.
Bhaiya iska implement hard tha yrr poora same approach soch tha maine 🥲🥲
Implementation with prority queue was easy, earlier i was trying to do it with multiset but dealing with iterators got complicated.
I find this implementation easier as it is hard to delete and deal with iterators at the same time as Itachi said
please upload the probelem D letter picking editorial
Will upload in the morning.
Great explanation
Thanks Zeyad
can u give the discord link,its not there in description
Added
Can we use sets???
Yes you can use multiset or a priority queue. But it gets to keep track of iterators in multiset. Better use priority queue.
Ohk sir
I get error if i use unordered map instead of map in this code
Unordered map can have collisions.
@@competitivecoding-newtonsc9601 i didn't understand the problem with this sir. Can't the collisions be handled? and does this mean we have to avoid unordered maps when dealing with large test cases
brother i solved this almost 30 minutes before contest end,but i use sets so got tle then i change the same code in arrays but i did a little mistake not able to find bug but i find the bug and submit 30sec after contest end and it got accepted and now i am pissed rn
Sad.
Please upload E Red Black Pepper
You can ask on discord. Video won't be possible.
Hope you are doing well sahil do your self a favour and read about islam ❤
i am an atheist.
@@competitivecoding-newtonsc9601 I know you are not muslim hence I told you read about islam , and i didnt tell you read about religions as there is only one religion, u know nothing comes for granted sahil put in the work , as the first question any human is asked after they die is "What is your religion" and if you answered by anything other than islam the following one is "Then what were you doing " meaning what were you doing being in other religion or being an athiest ? why Didnt you put in the work? why did you put the work in every thing in your life other than searching for your creator and why did he created you although he doesnt need you then why? why all the innocent people that die ?? why ? why there is suffering ?? If all that reduces nothing from his kingdom and all the people that are praying for him increase nothing in his kingdom then why? why there is evil why? Try preparing your answers before it is too late ❤