Блог пользователя Gagandeep98

Автор Gagandeep98, история, 4 года назад, По-английски

I won't be able to do this regularly as I am doing an internship as well. But I will be available on almost all weekends and most weekdays. Idea is to do a virtual contest in a team and of course, upsolve at least 1 problem.

Even giving virtual contests daily can become boring, so if we don't give a virtual contest on that day, we can try and choose the same topic and everyone will try to share problems that they found interesting and challenge others to solve that problem.

If you are interested, you can let me know. I will prefer it if you are able to solve at least 2 problems in div.2 contests.

Update: Let's give virtual team contests. Will keep the time as 11PM IST on non-contest days

Update 2: Moving to Discord Group Instead Of Whatsapp Invite Link: https://discord.gg/sUa7ccd

Полный текст и комментарии »

  • Проголосовать: нравится
  • -8
  • Проголосовать: не нравится

Автор Gagandeep98, история, 5 лет назад, По-английски

Can anyone please provide any hint for this problem? Throwing Dice

Полный текст и комментарии »

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

Автор Gagandeep98, история, 5 лет назад, По-английски

I am stuck on Counting Path 1136 problem, and unable to think how to write an approach optimal to given constraints. Any hint or help is highly appreciated.

I cannot find any place where there is any hint for CSES problems(Except DP and Range Queries), hence thought this as the only possible option.

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор Gagandeep98, история, 5 лет назад, По-английски

It is becoming very common that I am failing some of the test cases of CSES problems. I am getting WA on 3 out of 17 test cases. I am unable to figure out what is wrong in my approach.

Logic:

Step 1: Apply BFS for all monsters. Store in dist array, dist[i][j], shortest time among all monsters to reach, coordinate (i, j).

Step 2: Apply BFS for A. Store in d array, shortest time from A to coordinate (i, j). It is only possible to reach that coordinate if d[i][j] < dist[i][j]. Check if we have reached the border.

Step 3: Backtrack to generate the path.

PROBLEM LINK CODE LINK

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор Gagandeep98, история, 5 лет назад, По-английски

My logic is giving WA on 50% of the test cases. I am not able to figure out what is wrong with my logic. Any help would be great.

Logic: I apply a regular dfs, and return true or false. True indicates, that it is indeed the shortest the path, while false indicates, that it is not. If we get a true, then we update the parent node, else we don't.

Code: Code

UPDATE: Solved using DP but would be curious to know, if anyone can do it without DP.

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор Gagandeep98, история, 5 лет назад, По-английски

I tried to make a video on applying binary search. This is for beginners.

When To Apply Binary Search(For Beginners)

If it helps, you can let me know here or in the youtube comments. If you have any suggestions on what topics, I should cover, then do let me know that as well. If you feel that video is not upto the mark, then, feel free to share your feedback.

I will be happy to make a video on any specific topics, that newbies need help in.

Update: If you are downvoting, then please let me know your suggestions on what I should improve on.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

Автор Gagandeep98, история, 5 лет назад, По-английски

The editorialist's solution is not always the easiest one to understand, and I have to go through the entire blog to find who has shared his approach for that particular question.

LeetCode, although not a Competitive Programming website, has a better way of doing that. For each question, you have a discuss section, where you can post your own editorial. That makes it really easy to see all the different approaches used for a problem. Plus, I can sort by most upvotes, so it is very likely that I will find the best explanation at the top.

I think, having that kind of feature on codeforces will be really beneficial.

MikeMirzayanov

Полный текст и комментарии »

  • Проголосовать: нравится
  • +63
  • Проголосовать: не нравится