Intro to Competitive Programming
Вставка
- Опубліковано 28 лис 2024
- Most interesting video ever created. I don't know what I mispronounced but I definitely mispronounced something. Also Junferno's face is not in this video as much due to him falling into a state of anguish mid-recording (he was busy).
Patreon: / junferno
Twitter: / junferno
Join the Discord: / discord
Secondary Discord invite if vanity invite expires: / discord
Check out my other stuff on GitHub: github.com/kev...
Corrections:
[Visual error at 6:02] "Ultrecht" should be Utrecht
[Visual error at 10:32] Shortest path from A to C should be ADC, yielding a distance of 1+7=8, making the total distance from A to C to E: 8+12=20
Footnotes:
Other prominent online judges similar to Codeforces/DMOJ include AtCoder, Leetcode (mostly technical interview-type questions), Codechef, and TopCoder. CSES is an online judge focused on a single problemset. Advent of Code is a Christmas-themed daily programming challenge run annually in December in which only the output of the test cases has to be submitted as opposed to the solution code. Google Foobar is a "secret" Google programming challenge meant to be a recruiting technique targeted towards Google Search users who use keywords related to coding.
The technical term for a "network of nodes" is a "graph". Algorithms dealing with such graphs are categorised as graph theory algorithms. Nodes are connected by "edges" which may or may not have "weights". A directed graph is a graph in which the edges only go one way. An acyclic graph is a graph which contains no cycles.
A queue is different from a list in that it is not indexable, but rather just serves the element at the top when polled. A priority queue serves the element with the highest priority (usually implemented with heap). It does not actually "sort itself" but the elements will come out "sorted". The queue is sometimes referred to as "a list" in this video. This is meant to mean a "sequence of elements" and not the "list" data structure that exists in some languages.
The preferred language for most competitive programming is C++, though other languages are also used. Java, for example, is often used alongside a rewrite of the input reader class, as the built-in Scanner is too slow.
References: "For the absence of a bibliography I offer neither explanation nor apology." -- Edsger W. Dijkstra
Photos courtesy of Wikimedia Commons, GeeksForGeeks, DMOJ
DMOJ: dmoj.ca/
Codeforces: codeforces.com/
Single Source Shortest Path: dmoj.ca/proble...
VM7WC '15 #4 Gold - Chain Rule: dmoj.ca/proble...
Music tracklist:
• The Complete Junferno ...
Community Captions:
Portuguese (Brazil) - Guilherme BR
Corrections:
- [Visual error at 6:02] "Ultrecht" should be Utrecht
- [Visual error at 10:32] Shortest path from A to C should be ADC, yielding a distance of 1+7=8, making the total distance from A to C to E: 8+12=20
Honestly to most people (me) half of the video sounds like radio noise only changing when you randomly mention some stupid joke that makes me spit my drink so I don't think you have to be that worried.
Also: A Priority Queue is not a list that sorts itself, it is a queue that always returns the element with the highest priority next (usually the lowest value in a list of numbers). As a matter of fact, PQs usually get implemented using a Min-Heap (which, by keeping the heap invariant true, has always the lowest element as its root). Important to understand is that a PQ is not a list but a queue (a First-In-First-Out data structure which makes it impossible to do index calls) and is not (fully) sorted but only gives back the element with the highest priority / lowest value. Of course you can easily implement it by sorting a list once an element has been added but that is usually not how it is done because the computational overhead it generates for the little (to no - in a PQ we don't care about any other element than the next) benefit it gives us. Operating on a large dataset this can significantly affect the performance.
You based your explanation on your implementation and while the implementation of course works the explanation of a PQ is wrong. Just something I wanted to mention but other than that, nice video as always!
@@peatral Thanks! Clarification footnoted.
@@Junferno Nice, that is a really good footnote!
Me when dutch
Can't believe I got baited into watching an informative video just because it had a picture of Misato on it
Lmao same
omg did we really AHAHA 😭😭
literally
we are all goofy ahh people
you jus like me fr
He completely lost me when he started explaining that 2D array thing, but then he put Rei Evangelion in the video and completely won me over
2D arrays are great! 3D arrays are even more awesome. It's not as complicated as it seems.
same
I like it when she appears and says her catchphrase "it's rein' time!" And fires a deadly rays of gamma radiation
@@kakyoindonut3213 hilarious and original
@@zyrgr2940 ironic
This video should be renamed from "Intro to Competitive Programming" to "Overexplaining Dijkstra's Algorithm"
The title and the content of the video together perfectly captures what it's like to be a first-year CS student.
you mean uniform cost search
"Overexplaining Dutch Geography"
He must be a fan of Neil Degrasse Tyson!
"Overexplaining ____________ Algorithm" = second/first year cs classes lmao
"this is a list of Kirby antagonists"
...
"Stable marriage"
Stable marriage, the biggest Kirby antagonist.
russian peasant
Link cut tree.
Or just Z
@@kabliss4111 that sounds like a Zelda speedruning technique
i immediately love your videos more for taking a brief moment to list the cons of the VPN you used to counter the unintentional endorsement of non-sponsored product use.
me too, I actually paused to read them all
I love this kind of low-budget, high-humor videos
also
He explained it very intuitively
there is something charming about videos made on a not so big budget. but with a lot of effort
I also love no money high funny videos
as a Dutch I'm impressed with the pronunciation of these dutch cities, given Dutch is next to impossible to pronounce.
Every time I hear it, it makes my mouth feel weird because i'm imagining a muscle spasm in the roof of my mouth
just do the hard G and you’ve got the entire language down
As a non Dutch I will disagree, others failings to pronounce something might be because the people you are using for examples are English.
The english language kinda sucks for pronounciation.
@@unclassifiedsignal it is, we just learn to connect different sounds to the same letters.
And when ya used to it it takes ages to learn any other language ever
They asked me how well I understood theoretical computer science. I said I had a theoretical degree in computer science. They said welcome aboard.
lmao
New vegas, love it!
A "theoretical degree" lol ha.
u have a degree in theory huh, well that's professional enough! like, haggle your way out the coding interview, maybe!
Newsflash: Fantastic is irreplaceable.
I should have expected the end but it somehow took me by surprise
an evangelion themed competitive programming video
made for me honestly
It even has Touhou music to match your profile pic!
@@nixel1324 who's on the profile pic?
@@burnedpizzacrust1199 Marisa Kirisame, probably the closest Touhou has to a central protagonist after Reimu.
I like to imagine Jun got IP banned from CodeForces for playing Bad Apple on their verdict page
he probably did 💀
It was worth it tho😂😂
wait....how can he playing bad apple in the verdict page?? is there any some system that we can use??
@@arolimarcellinus8541 I just say what i see and am not knowledgeable about playing bad apple on anything...i think he just makes each frame with rows of text that instead of pixels use characters to make the frame. You can probably see the code when he ctrl+v it in there.
@@PurpleSpiritFoxFire About what he show at the end, it's most probably just javascript on his client side, as the timestamps stay constant (and the update is too fast compared to the start update time). But that would probably just be for the gag at the end of the video and not the actual attempt that made him banned, as it don't send anything to the server
As someone who finished up algorithms as one of my final courses out of college, this would have been a great video to show to our class on Dijkstra's.
You do them in final course? Our mf prof. just taught us C and went straight to Narasimha Karaumachi's DSA book.
everyone would pay attention when the rei part would come on
0:29 I love how you translated this sentence to specifically Chinese Russian and Polish, this describes the top competition pretty well
I can't believe you tricked me into reliving my algorithms and data structures class
All it took was anime
I always wanted to learn about competitive programming!
now i want to forget
Amazing pronunciation on everything, even "VM7WC".
Competitive programmers realizing their entire livelihood consists of only inverting binary trees 💀
Never in my competitive life have I inverted binary trees
@@arsenypogosov7206 You are in denial.
funny fast kirby man !
Looks like you have never did competitive programming.
L
6:51 the amount of whiplash between these two sentences is too much lmao. I love it
I was so lost at that point that I didn't even notice it lmao
Instead of the Gorilla Basket problem. This is the Programming Rei McDonalds problem.
Somehow the consistent Bad Apple endings manage to keep surprising me. I may have developed early-onset dementia since becoming a viewer.
7:45 When he started listing the algorithms, I was surprised by the amount of algorithms I never knew. Then I heard “Fecto Elfilis algorithm” and realized “wait.. that doesn’t sound right”
My dad went to a very small university in Canada and was on the programming team
They actually ended up going to the world championship in Hawaii and beat schools like MIT and Harvard
I never knew much about how it actually worked so this was a very nice way for me to be able to appreciate his achievements a bit more
He is still probably the smartest person I know
Thank you for the great video
He must be crazy smart cuz this is actually extremely intellectually difficult feet to accomplish
You should probably pick up programming you might have a gift for it too.
Is it Waterloo?
@@khoiduongminh5111Waterloo isn’t small
The entire explanation of the Dijkstra's algorithm was done in a way that maximized Jun's ability to flex his Dutch pronunciation.
Dickstroke's Algorithm was the thing that broke my brain when I tried to program it for my class and I didn't understand it before I came across this video. Now, after watching this video, I still don't understand it. Thanks, Junferno!
Dickstroke's algorithm
you were in the wrong class
Glad you managed to put Bad Apple in again.
I felt it's abstinence in the last video.
10/10
"The other city in the netherlands" 😂😂 funniest way to avoid saying groningen
I was on my university’s first real programming team. There were so few people interested that we didn’t even have to try out. We just volunteered and we were instantly on the team. We didn’t have enough time to learn all the relevant algorithms so my position on the team was to solve problems that nobody knew the algorithm for lol. I remember one of my ad hoc solutions being too slow for the judge so we wrote code that printed out a C array of the first 100 primes. Then we took that array and hardcoded it into the solution to reduce the final processing time.
Currently preparing for British Informatics Olympiad this year, I open UA-cam and see new Junfero competitive programming video with anime woman in thumbnail, nice algorithms very cool
Bro just randomly threw Touhou soundtrack in. LOVE IT
As a competitive programming nerd who took part in the Sud West European Regional Contest for ICPC of last year (my team lost, since we're not Russian), I can attest that this video is truthful, and also that competitive programming is a great source of -frustration- satisfaction.
Not sure what Misato has to do with this but I’m glad she’s here regardless
"This is a list of Kirby antagonists, actually."
Three seconds earlier: "Stable Marriage"
Before the video, I didn't know anything about competitive programming. Now that I've watched this, it's just as before. Thanks for explaining.
Yep 100% agree.
How is He putting so much information into my brain so fast. This video is 12 minutes long, and I feel like I've watched 1 hour long video essay.
that dijkstra example is exactly how my professor explained it (at utrecht university no less)
I SHOULD HAVE EXPECTED "IT" AT THE END
i understood less than usual and laughed more than usual, banger video thank you Junferno 🙏
the final problem reminds me of that way of decrypting a decryption key with only one one pair of encrypted/decrypted messages. instead of randomly guessing 100 different consecutive decryptions (a already encrypted encryption is recrypted several times to increase security) in order to find the proper decryption key, one can instead guess 50 decryptions on the encrypted message and do 50 reverse encryptions on the decrypted message and meet in the middle and compare all of the different half decrypted keys and see which ones match. Because the time needed to break an encryption increases exponentially with every layer of encryption, decreasing the time needed from t^100 to 2*t^50 where t is the time to guess a single layer of decryption is an extremely effective method. Thus, it is also extremely hard to have 2 middle points instead of 1 because there is no secure launching point to 'save progress'.
Wow this sure would've been helpful in my first ever competitive programming contest last week wow truly a crazy world am I right
I love how your videos have the power of curing my depression even though I've literally never coded anything in my entire life
Crazy how you made a video on competitive programming as soon as I started getting into it
Did you watch it? This was more a video on Dijkstra.
he lives in your walls
@@31redorange08 I just saw the video name and the first few seconds, I was still in school when the video was uploaded
Very nice surprise to see my country in your vid. Your pronounciation is on point! Having been to all these places myself I guess I have to agree with you :D The dijkstra guy kinda reminds me of walter white for some reason
I am fuckin SCREAMING at the ending, Juneferno strikes again
"Intro to Competitive Programming"
*Casually starts explaining Dijkstra's Algorithm
now im a god thank you junferno
MY GOD THIS MELTY SOUNDTRACK SOLD YOUR VIDEO TO ME
10:32 Is it just me or is the shortest path from A to C in this example clearly ADC, or 8 instead of 9?
Just you. Alien.
@@BGP00 it's impossible in real world but he's clearly right if you use the graph
@@BGP00 you can’t go from A to C directly here
@@omniladdrr6899 its not impossible, the line doesnt represent a straight path
@@ArbitraryCodeExecution fair enough
Wow! I'm now motivated to become a competitive programmer with absolutely no skills in programming. Thank you for letting me see the other side of the window
I literally spaced out listening to flowering night. You really need to add more obscure touhou references.
I clicked on your video because the thumbnail has to be the most eye catching thing ever. What does misato have to do with competitive programming? I‘ve seen it now and I am unable to turn down my urge to get an answer for the question. Props to that. Genius.
I didn’t really understand this video when it first came out but now but now it finally makes some sort of sense. I was learning about weighted graphs in data structures and algorithms today and instantly remembered this video
It was interesting to learn what Rei Evangelion would look like while working at McDonald’s. Very helpful and educational video, thanks!
firstly I would like to wish you well and to say a huge thank you for uploading these videos as they have been an invaluable resource to
Your videos are quite often the highlight of my day
New favorite channel. Delivery is art
The oneshot music was a pleasant suprise. Watching this on the world machine edition launch day.
10:26, it feels like the moment where the manga protagonist is revealing how he won at the end of the battle.
BROTHER, YOU ARE THE BEST!!! You oooh really helped me!! THANK YOU VERY MUCH!
Cool video! Honestly learning all the graph + sorting algorithms seems fun
I've been waiting for this kind of video for a really long time.
that shortest path with longest middle edge is a very informative problem nicely explained
your dedication to the bad apple meme is commendable
Loving these videos. Hope you keep making more
The bad apple surprise ending caught me off guard
You did prett well pronouncing those dutch cities. Definetly better that most non-dutch speakers.
I am a simple man. I see Misato. I click on it.
Thanks for your easy to follow explanations, one step at a ti. It makes learning less overwhelming!
First time to your channel and I accidentally got an explanation of the Dijkstra's algorithm. Came for the thumbnail, stayed for the informative tutorial (can I call it a tutorial though?). Anw, thank you and can't wait to see more videos like this.
My favorite Kirby antagonist, Suffix Automata 2.
Your pronunciation is... Excellent. Very respectful to learn it!
love this channel
Great style. Excited to see your next video.
Less go, new junferno vid
U tricked me into graph theory
My climb to grand master coder begins here
That's something a shounen protagonist would say lmao
great video, can't wait to come back to it in two weeks when my professor finally teaches us about djikstra's algorithm
Loved your dedication! Nice video!
Thats a whole new level of educational shitposting
you really put Misato Katsuragi on the thumbnail and I clicked for that but stayed for the content.
he likes eva and touhou and osu and programming he just like me fr
"An idiot admires complexity, a genius admires simplicity, a physicist tries to make it simple, for an idiot anything the more complicated it is the more he will admire it"
I signed up for an upcoming programming competition and boy am I fucked,....
HAHAHAHAHA I laughed a lot when you started showing the algorithm names, good video!
you spent so long debating how to get to Groningen you never considered if you should
i was worried there wasnt gonna be a bad apple this time. absolutely relieved
Wasn't planning on watching this video but the thumbnail won me over
gettin hit straight outta the gate with eltnum's theme made me leave a like. gonna go watch the rest of the vid now
I LOVE your videos
Nice video, finally i can add in to my resume 10y competitive programing experience
As someone that lives uncomfortably close to birmingham, I can confirm that there is no reason to go to birmingham. Also props for pronouncing it correctly
Bro just called Ayanami "Rei Evangelion" lmao 💀
prove him wrong
Damn, I loved the way this vid was put was together subbed XD
Congratulations you made something simple sound complex.
This was interesting and very funny, good job Junferno!
As Captian Falcon would say, "I lika ya moves!"
1:27 yeah playing bad apple definitely was an accident
It's a good day when you see a Junferno upload
You have my highest respect I love the style
I can say I was not expecting to hear blood drain again in the first 10 seconds of the video
Was watching this in my computer science class
I can confirm this is way more interesting
I love how almost all competitive programming discussions just devolve to graph theory and Birmingham.