@Competitive Programming with Shayan can you make a detailed video about 2000+ rating questions as to how to approach those not directly the solution to develop intution take differnt topics.
Hey dude I don't know why but I am really getting stuck in solving greedy, constructive algorithm questions. Could you please share some guidance as to what I should do in order to improve. I literally go blind as soon as I see the question. If I read like 1 or 2 line from editorial then I am able to pick up the idea otherwise I can't. Any suggestions?
@@adityaghosh6170 it takes time... everything takes times to grow my brother .. im not pro but i started from compilation error now at least i can solve 2-3 problems in each contest..
Don't use unordered maps as they're easily hackable (good avg case terrible worst case) If u don't care about the technical details u can skip the next part : Unordered maps are hashtables which means u need a hash function. Most hash functions usually use prime factorization, in cpp the prime numbers chosen are directly related to ur code, which means that the outputs are predictable. Therefore, it is easy to build a test case in which all of ur nodes will be in the same bucket of ur table - > linear time instead of constant time. Quick fix: use map
unordered map are implemented using hash tables while an ordered map is done using BST. So traversal time on latter one is O(logn) while that of previous is O(n). Therefore unordered map gave tle.
shayan, i cant thank you enough for making these post contest dicussion videos
The explaination to every problem was up to the point , no time waste .I loved it
Thank you so much. I'm really glad that I discovered your channel:))
I wasted a lot of time on C because I didn't notice the line that sum of lengths of ALL strings ≤ 2 * 10^5
@Competitive Programming with Shayan can you make a detailed video about 2000+ rating questions as to how to approach those not directly the solution to develop intution take differnt topics.
great thank you so much man.
Read about islam shayan.❤
This Div 3 round C is considerably harder than the previous one. D is pretty straightforward though. Thanks for your explanation!
Hey dude I don't know why but I am really getting stuck in solving greedy, constructive algorithm questions. Could you please share some guidance as to what I should do in order to improve. I literally go blind as soon as I see the question. If I read like 1 or 2 line from editorial then I am able to pick up the idea otherwise I can't.
Any suggestions?
practice practice practice... there's no other way
@@Isaadqurashi I am dude....I really am... Just a bit disappointed with my performance
@@adityaghosh6170 it takes time... everything takes times to grow my brother .. im not pro but i started from compilation error now at least i can solve 2-3 problems in each contest..
when i stuck on first problems i think hmmm what first thing that tourist would come up with. And usually all bad ideas go away.
@@Isaadqurashi well that's great. If you can solve 3 problems in div 2 that's a lot of progress
C problem explanation was great
i got alot of TLEs on this contest
i have a tle in c using unordered maps, anyone knows why?
+1
problem b right ? Me too i used another vector to mark
Don't use unordered maps as they're easily hackable (good avg case terrible worst case)
If u don't care about the technical details u can skip the next part :
Unordered maps are hashtables which means u need a hash function. Most hash functions usually use prime factorization, in cpp the prime numbers chosen are directly related to ur code, which means that the outputs are predictable. Therefore, it is easy to build a test case in which all of ur nodes will be in the same bucket of ur table - > linear time instead of constant time.
Quick fix: use map
@@georgeskhater487 can you explain with an eg!
unordered map are implemented using hash tables while an ordered map is done using BST. So traversal time on latter one is O(logn) while that of previous is O(n). Therefore unordered map gave tle.
In this contest, i got so many TLE. Since there was not any penalty on points on any WA, or else...
First work in ur English
u too
his english is perfectly comprehensible