Codeforces Round

  Рет қаралды 24,820

William Lin (tmwilliamlin168)

William Lin (tmwilliamlin168)

Күн бұрын

Пікірлер: 122
@jeetganatra7977
@jeetganatra7977 4 жыл бұрын
Please regularly upload... All the contests.. Even if you don't win it 😝
@kushagrasahni9708
@kushagrasahni9708 4 жыл бұрын
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.
@NishArcturus
@NishArcturus 4 жыл бұрын
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)
@sanchitkumawat3803
@sanchitkumawat3803 4 жыл бұрын
how did u solve problem F in so less code than its editorial and yours is easy to understand as well.
@mohammedamaan7351
@mohammedamaan7351 4 жыл бұрын
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.
@NishArcturus
@NishArcturus 4 жыл бұрын
Man I can literally watch your vids all day😂
@AmitKumar-kj6hh
@AmitKumar-kj6hh 4 жыл бұрын
Thanks William lin , your video helpful for us 🙂
@LyTran-tj7sy
@LyTran-tj7sy 4 жыл бұрын
Please continue this series. It helps us a lot.
@blueexorcist4300
@blueexorcist4300 4 жыл бұрын
Not only you are an amazing coder but also you explain things very well... please please keep doing this!
@santhoshdeepu4293
@santhoshdeepu4293 2 жыл бұрын
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.
@akshar4548
@akshar4548 4 жыл бұрын
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 ❤️
@georgielee3690
@georgielee3690 4 жыл бұрын
yo what keyboard do you use? you should make a setup video ^_^
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
It's a random mechanical keyboard... Yea sure I might show my physical setup one day, it would be pretty short tho
@cqtShadow
@cqtShadow 4 жыл бұрын
love your video, and just want to be like you
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
Doing a lot of practice is the key for anything.
@omar-elaraby
@omar-elaraby 4 жыл бұрын
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 ?
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
I didn't have a roadmap
@josephwong2832
@josephwong2832 3 жыл бұрын
love these solutions
@ritwikchakraborty1702
@ritwikchakraborty1702 4 жыл бұрын
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??
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
Yes, you can learn a lot from reading others' codes
@ritwikchakraborty1702
@ritwikchakraborty1702 4 жыл бұрын
@@tmwilliamlin168 thaks Willam...I am also in your discord...if any doubt comes to me...I will take help from you obviously
@shashikantpunia9019
@shashikantpunia9019 4 жыл бұрын
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...
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
Why 4? Can you list out the 4 strings?
@vaibhavpandey5615
@vaibhavpandey5615 4 жыл бұрын
thankyou lin ,we need this..
@ibroq1
@ibroq1 4 жыл бұрын
i just came here to hear sound of typing level 9000
@andremanada5175
@andremanada5175 4 жыл бұрын
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
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
Consider a bamboo and a bunch of queries, all of them with the deepest node.
@shmaestro
@shmaestro 4 жыл бұрын
Incredible speed! Question on A: why take (b-a) instead of (a-b) in the calculation - just trying to understand the intuition on this..
@mohammedabutair4627
@mohammedabutair4627 4 жыл бұрын
if(a
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
Each time you add 1 to a, (b-a) decreases by 1.
@shmaestro
@shmaestro 4 жыл бұрын
@@tmwilliamlin168 Cool, thanks!
@naranbat.m8026
@naranbat.m8026 4 жыл бұрын
Pls tell me, why u use GVIM, dev-c++ ide is not better? What reason is why you choose GVIM?
@unuuunudelger6779
@unuuunudelger6779 4 жыл бұрын
Thank you
@aniruddhashrikhande1178
@aniruddhashrikhande1178 4 жыл бұрын
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?
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
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.
@teji7723
@teji7723 4 жыл бұрын
I understand 67% of what he is saying. C++ language can be spoken!
@jonathanlouis6776
@jonathanlouis6776 4 жыл бұрын
You inpired me to create a channel youtube like this XD. Thanks for the explanation !!
@srikarummineni307
@srikarummineni307 4 жыл бұрын
Sir please upload them regularly Was missing this very much Thanks a lot..!!!
@mayankkumarprajapati1763
@mayankkumarprajapati1763 4 жыл бұрын
You are doing awesome work bro..
@TahsinAhmed-yj9ns
@TahsinAhmed-yj9ns 4 жыл бұрын
thanks for making this
@rahulanandyadav1039
@rahulanandyadav1039 4 жыл бұрын
Can you tell your coding environment setup? The program you use and other configurations
@utsavpati5855
@utsavpati5855 4 жыл бұрын
I am a big fan of yours and please upload solutions regularly
@DharanAditya
@DharanAditya 4 жыл бұрын
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
@ishansourav4142
@ishansourav4142 4 жыл бұрын
bro can you explain why did you take xor of anc[u][i] & anc[v][i] ?
@mohamedSayed-lr4xs
@mohamedSayed-lr4xs 4 жыл бұрын
could you please tell me what kind of keyboard you are using ??
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
A mechanical keyboard
@MD-hx3wf
@MD-hx3wf 4 жыл бұрын
Hi, Which keyboard do you have?
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
Some random mechanical keyboard
@MD-hx3wf
@MD-hx3wf 4 жыл бұрын
William Lin - blue switches I assume? :)
@aditya_jain
@aditya_jain 4 жыл бұрын
Thanks and keep going
@suryakantasahoo9935
@suryakantasahoo9935 4 жыл бұрын
Keep it up man, helps a lot!
@yinghanma1314
@yinghanma1314 4 жыл бұрын
Could you also post some explanation video about quesitons in leetcode weekly contests?
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
Yes, for LeetCode weekly contests, I don't separate the contest and the explanations
@bhaweshmadhwani1801
@bhaweshmadhwani1801 4 жыл бұрын
Thanks man🙌♥️♥️
@scoopedcontent
@scoopedcontent 4 жыл бұрын
PLEASE make a video on complete road map for competitive programming......
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
I don't know the complete road map for CP
@yashveernathawat8154
@yashveernathawat8154 4 жыл бұрын
i was stuck at problem1...How should i improve? Although its my 1st contest
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
That's normal for a 1st contest. Just do more practice.
@pandalove6795
@pandalove6795 4 жыл бұрын
Please explain how the code works in B.cpp?
@vinaykumarbisht3008
@vinaykumarbisht3008 4 жыл бұрын
When did you started competitive programming?
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
3 years ago
@kabboghosh1853
@kabboghosh1853 4 жыл бұрын
great teaching
@visluck
@visluck 4 жыл бұрын
🔥🔥
@sandipanhaldar61
@sandipanhaldar61 4 жыл бұрын
can you elaborate the variable s in prob D
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
The start of the array (I shift the array circularly)
@utsavpati5855
@utsavpati5855 4 жыл бұрын
And if possible please upload the Codeforces div 2 solutions held recently
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
Sometimes if I'm unable to upload video solutions I will provide brief solutions in my Discord (link in the description)
@sumitbisht4161
@sumitbisht4161 4 жыл бұрын
Can you please be more clear while giving explanation cuz I didn't got nothing about kth beautiful string!!
@divyanshubist8527
@divyanshubist8527 4 жыл бұрын
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??
@psw1
@psw1 4 жыл бұрын
You might be doing it using brute force. and looking at the constraints that won't paas. try to solve mathematically
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
You need an efficient algorithm, and you might be getting runtime error
@attrinh9412
@attrinh9412 4 жыл бұрын
Thank u
@kunal_chand
@kunal_chand 4 жыл бұрын
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.
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
I'm doing that in my Discord server (link in the description)!
@GannaJuiceEnthusiast
@GannaJuiceEnthusiast 4 жыл бұрын
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?
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
We consider all 4 cases, no elements from left/right, elements from left, elements from right, elements from both left&right.
@GannaJuiceEnthusiast
@GannaJuiceEnthusiast 4 жыл бұрын
@@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...
@khshgeiye4810
@khshgeiye4810 4 жыл бұрын
C's solution is the interesting one
@codeWithBatta
@codeWithBatta 4 жыл бұрын
bravo brother love you
@DHANUSHrockyartist
@DHANUSHrockyartist 4 жыл бұрын
❤️
@sihabsahariar
@sihabsahariar 4 жыл бұрын
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); } }
@satyamkumar2820
@satyamkumar2820 4 жыл бұрын
which editor is this?
@saifu07
@saifu07 4 жыл бұрын
Please upload explanation video of Kickstart A, Thanks
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
Sorry, I got busy, and Google already has analysis for those problems
@gopikrishna1551
@gopikrishna1551 4 жыл бұрын
can u please explain D i am unable to understand it
@AlexandrBorschchev
@AlexandrBorschchev 4 жыл бұрын
i'm a beginner, please give advice i'm very interested!
@organic2976
@organic2976 4 жыл бұрын
Hey broly, make a video on your setup?
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
Thinking about it :)
@organic2976
@organic2976 4 жыл бұрын
@@tmwilliamlin168 waiting
@pranjalagnihotri6072
@pranjalagnihotri6072 4 жыл бұрын
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
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
In which part of my explanation did you get confused?
@psw1
@psw1 4 жыл бұрын
@@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
@pranjalagnihotri6072
@pranjalagnihotri6072 4 жыл бұрын
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?
@classcure9769
@classcure9769 4 жыл бұрын
i didn't understand B.....I am a new coder pls help someone
@crazymemes4080
@crazymemes4080 4 жыл бұрын
Give us some tips bro related to competitive programming 😬
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
Practice a lot
@gentleman4615
@gentleman4615 4 жыл бұрын
Practice means only problem solvinG?
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
Yea
@muhamedabdalla2301
@muhamedabdalla2301 4 жыл бұрын
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.
@pranjalagnihotri6072
@pranjalagnihotri6072 4 жыл бұрын
Man you are doing so great solving problems till D needs much much practice 🌸
@atishayjain9341
@atishayjain9341 4 жыл бұрын
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-id5qq6ov3w
@user-id5qq6ov3w 4 жыл бұрын
Is it only me that doesn't even know what Codeforces is
@halfblood_slayer5989
@halfblood_slayer5989 4 жыл бұрын
Its a very light weight website and hardly breaks check it out
@mohammadistiaquddin9543
@mohammadistiaquddin9543 4 жыл бұрын
Which IDE do you use bro?
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
GVim
@abylay_gaming
@abylay_gaming 4 жыл бұрын
I hear frogs))
@ak.pod31
@ak.pod31 4 жыл бұрын
Why can't we just do a%b for the first one
@sadmansakib007
@sadmansakib007 4 жыл бұрын
a = 5 b = 8 a % b = 5 % 8 = 5 But we need 3 moves to make 5 to 8.
@akshaykumar-rv7gt
@akshaykumar-rv7gt 4 жыл бұрын
Which ide di u use?
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
GVim
@dulanwaduge
@dulanwaduge 4 жыл бұрын
whats your keyboard?
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
Some mechanical keyboard
@adityamishra4458
@adityamishra4458 4 жыл бұрын
u did not explained educational round 84 i was waiting
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
I got busy that day, sorry.
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
The editorials are already on CF so probably not
@thepenguin7324
@thepenguin7324 4 жыл бұрын
Happy 666e1 subs
@mrinallumasudhan280
@mrinallumasudhan280 4 жыл бұрын
I honestly think you can get a job at google pretty easily!
@himanshunegi5228
@himanshunegi5228 4 жыл бұрын
nice video sir can you please speak slow.😊😜
@tmwilliamlin168
@tmwilliamlin168 4 жыл бұрын
I'll try to remember
@akshat1234100
@akshat1234100 4 жыл бұрын
Thank you
Codeforces Round #629 (Div. 3) (20th)
54:20
William Lin (tmwilliamlin168)
Рет қаралды 19 М.
Winning Codeforces Round #628 (Div. 2) + Facecam
1:08:33
William Lin (tmwilliamlin168)
Рет қаралды 393 М.
What's in the clown's bag? #clown #angel #bunnypolice
00:19
超人夫妇
Рет қаралды 27 МЛН
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33
火影忍者一家
Рет қаралды 131 МЛН
SISTER EXPOSED MY MAGIC @Whoispelagheya
00:45
MasomkaMagic
Рет қаралды 14 МЛН
Codeforces Round #634 (Div. 3) Explanations
23:26
William Lin (tmwilliamlin168)
Рет қаралды 22 М.
New largest prime number found! See all 41,024,320 digits.
10:14
Stand-up Maths
Рет қаралды 335 М.
What P vs NP is actually about
17:58
Polylog
Рет қаралды 115 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 721 М.
Just enough C to have fun
39:29
Kay Lack
Рет қаралды 56 М.
Winning Codeforces Round #663 (Div. 2)
46:18
William Lin (tmwilliamlin168)
Рет қаралды 98 М.
I AM RANKED #1 IN THE WORLD 🌎🏆
23:32
Ryley - Clash Royale
Рет қаралды 48 М.
how to study less and get higher grades
11:16
Gohar Khan
Рет қаралды 780 М.
Using MAXED Evolution Mega Knight in Mid Ladder
14:39
Orange Juice Gaming
Рет қаралды 208 М.
What's in the clown's bag? #clown #angel #bunnypolice
00:19
超人夫妇
Рет қаралды 27 МЛН