Comments

are they hiring ?

Lack of Introduction to Mathematical competitions in school is i guess the major culprit. If india also starts having mathematical circles like those which are in Russia, then there may be possibilities of LGM. But seeing the current mindset of typical Indian parents and lack of a good education system, it seems hard in near future.

That part is well explained in CLRS. You might want to take a look at it.

You can use the concept of discovery time and finish time.If we know the distance of node x , let it be a , then distance of all those nodes will be a + p. For every distance d , we will push all the node's discovery time and finishing time whose distance is d. Now , according to properties of dfs, all the nodes which are in subtree of node x will have discovery time > discovery time of x, and finishing time <= finishing time of node x. Since , we also know that all those nodes are at distance a + p. We will go to that distance vector and find number of nodes which has the above mentioned property. For more clarity, you can check out my Submission :)

I was in the same situation like yourselves some time before.What I did was some basic problems from geeksforgeeks , and saw that there is a pattern in each of them. What actually helped me is the visualisaation of each problem which involved recursion. I recommend you to start tracing it for like 10-20 problems to get a feel of it. After you get the visualisation, only thing left is implementing it in a number of ways on a lot of problems. for that you could write your own solution and try comparing different solutions of that problem . Trust me , you will learn it . It took me 3 days to gain confidence. In that span of time , I solved problems from GFG, hackerrank , hackerearth, UVA online judge, leetcode, interviewbit, codeforces etc. You get what i am trying to say. Hunt problems of recursion and kill them. xD Recursion will become one of your strong topic in no time. Best of luck :)

On OLDACCOUNTHow to learn English?, 6 years ago
0

For learning how to write grammatically correct sentences , try to find a book which has exercises on translating sentences from your mother tongue to English. Solving those questions will improve your writing skills a lot. If you want to make your vocabulary strong, read novels. For speaking and gaining confidence, the best way is to speak as much as you can. For this , you can try teaching algorithms and data structures to native English speakers who are beginners here. P.S — I am not a native English speaker and you may find many grammatical errors in the above phrase.

On tri_eSUGGESTIONS NEEDED, 6 years ago
0

Hey, I will tell you how I approach. As a beginner in DP,I always struggled, like how to approach . Is it always that I have to think of recursive solution or sometimes it is beneficial to think of bottom up. So, I observed that the main thing which was tough for me was coming up with a recurrence relation. It just felt like magic. It was tough to come up with but when i saw the editorial, it seemed it is obvious. So , then what I did was to just keep thinking why I was not able to come up with that recurrence, where i went wrong or got confused . When i started doing in these type of problems, then slowly I was able to think correctly. So when people say, DP comes with practice , I think this is the area where people get more and more experienced with solving problems. So basically what i have solved till now is around 200 dp problems from 1600 to 1800 ( almost all on codeforces) and around 135 on leetcode. So, approach should be think hard, like don't give up for at least 1 hour or 1.5 hour. It has happened to me that I got the idea to solve a problem after 1.5 hours of thinking. and then if you don't get the solution then read editorial. Its not just for getting AC. You should be clear on why you were not able to think , is it was some hard to see observation, or some new concept. It may also be possible that you were going correct but you deviated along the way. In that way you learn a lot on hoe to think correctly on a problem and I think this strategy works for all kind of problems.

On tri_eSUGGESTIONS NEEDED, 6 years ago
+4

If you consider weak at DP, then you may try solving a bunch of problems on it.As per my experience, whatever I have learnt till now, I can tell you after you are all clear with the basics of a topic and you are able to use it while thinking, it all boils down to problem solving skills. If you really want to try some DP problems then (my opinion) you can go to leetcode DP section. They have a nice collection which covers almost all basic DP variants.Then you can randomnly solve problems on Codeforces for enhancing problem solving skills. Hope it helps.

Can I join? I really want to learn from you guys :)

0

for me i was just considering nodes on shortest path from a to b. when i removed that condition i.e checked for every node, I got AC.

On lrvideckisWhy do you do CP?, 6 years ago
+8

Just wondering, if there exists universities which forces students to take part in algorithmic contest rather than just coursework.I would be lucky to get into those universities. :D

Registration link is not working.

+9

Fix B.Find A and C greedily.

0

Form a graph from a[i]-i to i and a[i]+i to i.(a[i] -i >=1 , a[i]+i<=n) traverse the adjacency list and insert points on the other side of the edge in the queue if parity of both points are diffrent. (these points will have minimum distance which is 1). perform bfs.

I am confused in test case 3 of problem C. Why the solution of test case 3 in Problem C can't be 6 1 2 3 3 2 1. Even if 1 is deleted from the sequence , shortest path from 3 to 3 is of distance 2 only.

+1

In your code :- " auto bs =pam.lower_bound(n-a[i]); " It may point to pam.end();

can someone please explain about 0-1 graph coloring and some resources to learn it. This topic is quite new to me. Thanks in advance :D