Please regularly upload... All the contests.. Even if you don't win it 😝
@kushagrasahni97084 жыл бұрын
I solve E this way: I stored in and out times of all nodes. Then in each query, pushed the in and out times of the parent of every vertex in the query in a vector of pairs. Then I sorted the vectors and iterated through it to check if every node is an ancestor of the next node.
@NishArcturus4 жыл бұрын
No need of vectors man if you have in and outs then you can check ancestors in O(1) just by comparing, they have a whole section in CLRS on the same IN(CHILD)>IN(ANC) && OUT(CHILD)
@sanchitkumawat38034 жыл бұрын
how did u solve problem F in so less code than its editorial and yours is easy to understand as well.
@mohammedamaan73514 жыл бұрын
Thank you so much man. You are a legend. Your work is helping me so much. Please be uploading videos like these in the future contests as well.
@NishArcturus4 жыл бұрын
Man I can literally watch your vids all day😂
@AmitKumar-kj6hh4 жыл бұрын
Thanks William lin , your video helpful for us 🙂
@LyTran-tj7sy4 жыл бұрын
Please continue this series. It helps us a lot.
@blueexorcist43004 жыл бұрын
Not only you are an amazing coder but also you explain things very well... please please keep doing this!
@santhoshdeepu42932 жыл бұрын
Bro i can't even understand one code solution and i know java basics and oops and currently leaning DSA(SLL,DLL,CLL, stack,queue) now learning tree can you suggest me how to increase my programming skills.
@akshar45484 жыл бұрын
If possible please upload videos after every major contest ( also from codechef) so that we can learn from u and improve our mistakes....thank u brother for doing this ❤️
@georgielee36904 жыл бұрын
yo what keyboard do you use? you should make a setup video ^_^
@tmwilliamlin1684 жыл бұрын
It's a random mechanical keyboard... Yea sure I might show my physical setup one day, it would be pretty short tho
@cqtShadow4 жыл бұрын
love your video, and just want to be like you
@tmwilliamlin1684 жыл бұрын
Doing a lot of practice is the key for anything.
@omar-elaraby4 жыл бұрын
Good job bro, that was helpful. And best wishes in your next IOI :). And could you share with us your road map of your early practice ?
@tmwilliamlin1684 жыл бұрын
I didn't have a roadmap
@josephwong28323 жыл бұрын
love these solutions
@ritwikchakraborty17024 жыл бұрын
William can you tell me...how to learn when we are doing some code..do we should see other solutions for improvement or any other way??
@tmwilliamlin1684 жыл бұрын
Yes, you can learn a lot from reading others' codes
@ritwikchakraborty17024 жыл бұрын
@@tmwilliamlin168 thaks Willam...I am also in your discord...if any doubt comes to me...I will take help from you obviously
@shashikantpunia90194 жыл бұрын
in 2nd question, you said no of strings whose first character at position i is n-i-1, but for n = 5 and i = 3,the no of string whose first character at position 3 is 4, n-i-1 is 1... may be i understood it wrong ! plz resolve mine doubt...
@tmwilliamlin1684 жыл бұрын
Why 4? Can you list out the 4 strings?
@vaibhavpandey56154 жыл бұрын
thankyou lin ,we need this..
@ibroq14 жыл бұрын
i just came here to hear sound of typing level 9000
@andremanada51754 жыл бұрын
i used dfs to calculate the path from u to root, and put the path on a set, then checked for every node if it or the parent were on the set, got tle on case 58
@tmwilliamlin1684 жыл бұрын
Consider a bamboo and a bunch of queries, all of them with the deepest node.
@shmaestro4 жыл бұрын
Incredible speed! Question on A: why take (b-a) instead of (a-b) in the calculation - just trying to understand the intuition on this..
@mohammedabutair46274 жыл бұрын
if(a
@tmwilliamlin1684 жыл бұрын
Each time you add 1 to a, (b-a) decreases by 1.
@shmaestro4 жыл бұрын
@@tmwilliamlin168 Cool, thanks!
@naranbat.m80264 жыл бұрын
Pls tell me, why u use GVIM, dev-c++ ide is not better? What reason is why you choose GVIM?
@unuuunudelger67794 жыл бұрын
Thank you
@aniruddhashrikhande11784 жыл бұрын
Regarding question F, how can we prove that it is optimal to always have the K equal numbers as some pre-existing element of the array? Why can't we have K equal numbers which were initially not present in the array?
@tmwilliamlin1684 жыл бұрын
I actually haven't thought of that, but its proof is related to this proof: math.stackexchange.com/questions/113270/the-median-minimizes-the-sum-of-absolute-deviations-the-l-1-norm Basically, if we increase a elements and decrease b elements to become x, if ab, x-1 will give a better answer.
@teji77234 жыл бұрын
I understand 67% of what he is saying. C++ language can be spoken!
@jonathanlouis67764 жыл бұрын
You inpired me to create a channel youtube like this XD. Thanks for the explanation !!
@srikarummineni3074 жыл бұрын
Sir please upload them regularly Was missing this very much Thanks a lot..!!!
@mayankkumarprajapati17634 жыл бұрын
You are doing awesome work bro..
@TahsinAhmed-yj9ns4 жыл бұрын
thanks for making this
@rahulanandyadav10394 жыл бұрын
Can you tell your coding environment setup? The program you use and other configurations
@utsavpati58554 жыл бұрын
I am a big fan of yours and please upload solutions regularly
@DharanAditya4 жыл бұрын
You are doing great job bro. I am regularly visiting your channel. I have difficulty understanding the second problem kth string even afternoon watchiny your explanation multiple times. Can you help me
@ishansourav41424 жыл бұрын
bro can you explain why did you take xor of anc[u][i] & anc[v][i] ?
@mohamedSayed-lr4xs4 жыл бұрын
could you please tell me what kind of keyboard you are using ??
@tmwilliamlin1684 жыл бұрын
A mechanical keyboard
@MD-hx3wf4 жыл бұрын
Hi, Which keyboard do you have?
@tmwilliamlin1684 жыл бұрын
Some random mechanical keyboard
@MD-hx3wf4 жыл бұрын
William Lin - blue switches I assume? :)
@aditya_jain4 жыл бұрын
Thanks and keep going
@suryakantasahoo99354 жыл бұрын
Keep it up man, helps a lot!
@yinghanma13144 жыл бұрын
Could you also post some explanation video about quesitons in leetcode weekly contests?
@tmwilliamlin1684 жыл бұрын
Yes, for LeetCode weekly contests, I don't separate the contest and the explanations
@bhaweshmadhwani18014 жыл бұрын
Thanks man🙌♥️♥️
@scoopedcontent4 жыл бұрын
PLEASE make a video on complete road map for competitive programming......
@tmwilliamlin1684 жыл бұрын
I don't know the complete road map for CP
@yashveernathawat81544 жыл бұрын
i was stuck at problem1...How should i improve? Although its my 1st contest
@tmwilliamlin1684 жыл бұрын
That's normal for a 1st contest. Just do more practice.
@pandalove67954 жыл бұрын
Please explain how the code works in B.cpp?
@vinaykumarbisht30084 жыл бұрын
When did you started competitive programming?
@tmwilliamlin1684 жыл бұрын
3 years ago
@kabboghosh18534 жыл бұрын
great teaching
@visluck4 жыл бұрын
🔥🔥
@sandipanhaldar614 жыл бұрын
can you elaborate the variable s in prob D
@tmwilliamlin1684 жыл бұрын
The start of the array (I shift the array circularly)
@utsavpati58554 жыл бұрын
And if possible please upload the Codeforces div 2 solutions held recently
@tmwilliamlin1684 жыл бұрын
Sometimes if I'm unable to upload video solutions I will provide brief solutions in my Discord (link in the description)
@sumitbisht41614 жыл бұрын
Can you please be more clear while giving explanation cuz I didn't got nothing about kth beautiful string!!
@divyanshubist85274 жыл бұрын
I solved the first problem on my laptop but it exceeds time limit while submitting .how can I improve that? And pls explain what does checker's comment-"exit code is 4"means??
@psw14 жыл бұрын
You might be doing it using brute force. and looking at the constraints that won't paas. try to solve mathematically
@tmwilliamlin1684 жыл бұрын
You need an efficient algorithm, and you might be getting runtime error
@attrinh94124 жыл бұрын
Thank u
@kunal_chand4 жыл бұрын
Can u create a channel on telegram in which you post contest reminders before participating. It will be very helpful for us to follow along with your explanations.
@tmwilliamlin1684 жыл бұрын
I'm doing that in my Discord server (link in the description)!
@GannaJuiceEnthusiast4 жыл бұрын
20:50 how does considering whole prefix and suffix sum gives me the answer??, I mean their could be some elements from the left and some elements from the right, why does considering all elements gives us the answer?
@tmwilliamlin1684 жыл бұрын
We consider all 4 cases, no elements from left/right, elements from left, elements from right, elements from both left&right.
@GannaJuiceEnthusiast4 жыл бұрын
@@tmwilliamlin168 i got that, didn't read the qustn correctly...we can only change the greatest and the smallest element....my bad... btw thanx a lot...
@khshgeiye48104 жыл бұрын
C's solution is the interesting one
@codeWithBatta4 жыл бұрын
bravo brother love you
@DHANUSHrockyartist4 жыл бұрын
❤️
@sihabsahariar4 жыл бұрын
Hey I'm a beginner. Why did I get TLE in this code? int main() { int t; scanf("%d",&t); while(t--) { int a,b,count=0; scanf("%d %d",&a,&b); while(a%b!=0) { a++; count++; } printf("%d ",count); } }
@satyamkumar28204 жыл бұрын
which editor is this?
@saifu074 жыл бұрын
Please upload explanation video of Kickstart A, Thanks
@tmwilliamlin1684 жыл бұрын
Sorry, I got busy, and Google already has analysis for those problems
@gopikrishna15514 жыл бұрын
can u please explain D i am unable to understand it
@AlexandrBorschchev4 жыл бұрын
i'm a beginner, please give advice i'm very interested!
@organic29764 жыл бұрын
Hey broly, make a video on your setup?
@tmwilliamlin1684 жыл бұрын
Thinking about it :)
@organic29764 жыл бұрын
@@tmwilliamlin168 waiting
@pranjalagnihotri60724 жыл бұрын
Please someone explain me how to solve problem B, like how can we find the kth permutation directly. I looked into few articles where the idea was to use factorial number system but couldn't understand it properly. Please please provide few pointers
@tmwilliamlin1684 жыл бұрын
In which part of my explanation did you get confused?
@psw14 жыл бұрын
@@tmwilliamlin168 your solution was perfect for this question in whichh there was constraint on number of b's and a's but what about a more general problem in which we need to find kth permutation of any general string
@pranjalagnihotri60724 жыл бұрын
I don't understand the idea behind doing ` if (k < n - 1 - i) `. Also why you started at n-2 and not at n-1?
@classcure97694 жыл бұрын
i didn't understand B.....I am a new coder pls help someone
@crazymemes40804 жыл бұрын
Give us some tips bro related to competitive programming 😬
@tmwilliamlin1684 жыл бұрын
Practice a lot
@gentleman46154 жыл бұрын
Practice means only problem solvinG?
@tmwilliamlin1684 жыл бұрын
Yea
@muhamedabdalla23014 жыл бұрын
wow, your solution in D is so beautiful, I solved it using dp, i hope that i can solve all like u but f break me :D, Keep going bro.
@pranjalagnihotri60724 жыл бұрын
Man you are doing so great solving problems till D needs much much practice 🌸
@atishayjain93414 жыл бұрын
It was easy I solved it as he solved it but he code is so less..... I don't know how he finishes the problem with a little code only where I wrote a very long code !!!! That's why I like him checking every ans after the contest just to check how did he wrote in sort
@user-id5qq6ov3w4 жыл бұрын
Is it only me that doesn't even know what Codeforces is
@halfblood_slayer59894 жыл бұрын
Its a very light weight website and hardly breaks check it out
@mohammadistiaquddin95434 жыл бұрын
Which IDE do you use bro?
@tmwilliamlin1684 жыл бұрын
GVim
@abylay_gaming4 жыл бұрын
I hear frogs))
@ak.pod314 жыл бұрын
Why can't we just do a%b for the first one
@sadmansakib0074 жыл бұрын
a = 5 b = 8 a % b = 5 % 8 = 5 But we need 3 moves to make 5 to 8.
@akshaykumar-rv7gt4 жыл бұрын
Which ide di u use?
@tmwilliamlin1684 жыл бұрын
GVim
@dulanwaduge4 жыл бұрын
whats your keyboard?
@tmwilliamlin1684 жыл бұрын
Some mechanical keyboard
@adityamishra44584 жыл бұрын
u did not explained educational round 84 i was waiting
@tmwilliamlin1684 жыл бұрын
I got busy that day, sorry.
@tmwilliamlin1684 жыл бұрын
The editorials are already on CF so probably not
@thepenguin73244 жыл бұрын
Happy 666e1 subs
@mrinallumasudhan2804 жыл бұрын
I honestly think you can get a job at google pretty easily!