give me the link of updated submission , I am not very good with python but I will try to figure out the problem
youâre welcome man
Hey! Can you please solve this problem from codeforces?It is a dp problem and I canât solve it for the larger constraints
Thanks!
This is where I declared the matrices globally :-
Click Here
And this is where I tried a lot of modifications and declared the matrices locally :-
Click Here
I donât know if youâll be able to access the links but in case you canât then here are the two codes as well :-
Globally
Locally
If you canât figure out the problem, then itâs fine anyway because a real test most likely wonât have time limit this tight.
I think if you use fast IO , it can pass time limit.
I submitted your solution with global array and it is getting TLE in 3 test cases , in all those 3 test cases N and M are 1000 and 1000.
itâs not like your solution is asymptotically slower , if it was the case then your code would not be able to solve Test Case 7 which also has N and M as 1000 * 1000.
read this for fast IO or google : performance - Fastest stdin/out IO in python 3? - Stack Overflow
as I said again I am not very good with python so it will take a lot of time for me to implement and debug.
try for once
after a small change that I made , now the solution is getting TLE on only 2 test cases (3 previously) : https://ideone.com/HIlpK8
I am sure if you use fast I/O it will pass the time limit
I will try to use even faster I/O. Thanks.
gonna do this after exams, thanks a ton man
youâre welcome
Bro In Your Bridge Finding Algorithm , I think You might be missed some edge cases for disconnected graph ???
For example suppose this is the Question
Now suppose Tc is
1
5 3
0 1 1 2 3 4
3 4
Basically Graph is in the form
0-1-2
3-4
and asked that is 3-4 is bridge then Cp algo code giving WA.
{Our code give 0 but actually ans is 1(yes) }
My Solution {After Learning From Your Video}
PS:-
I have already spend 3+ hours to Get AC in this Question, Please let me know how to correct this code.
Finally,
YOU ARE OUR INSPIRATION, THANK-YOU FOR EVERYTHING WHICH YOU HAVE DONE FOR US!!!.
Thank you for this @waqar_ahmad224, a dumb suggestion/question, are you planning to make these videos available as a playlist on Youtube on the channel? so that one(like me) can watch all of them in one sitting? Please suggest.
I have playlist.
for graph there are these playlists.
these 2 are course.
after these for almost every platform I have playlist for practice problem
Consider making these for LeetCode problems too, it has a large no of users and it might boost your channelâŚ
I have some editorials from leetcode too.
May be need to add more
when is part 2 and 3 of this course is coming as you mentioned ?
arrey bhai