5 ms·
Yes as a former competitive programmer I think there are a lot of benefits to learning algorithms - It makes you habitual to pushing bug free code as there is
by aiunboxed 3y ago
Yes as a former competitive programmer I think there are a lot of benefits to learning algorithms
- It makes you habitual to pushing bug free code as there is a penalty you give in every wrong submission.
- You have to make sure that you get the submission done is shortest possible time, you learn to execute with speed.
- You have great debugging skills
- Edit (Edge cases as well)
- GuB-42 3y agoI have done a bit of competitive programming, occasionally, but I have never been in a competition where there is a penalty for wrong submission. You obviously have to fix your bugs to validate the answer, and you obviously lose time when you didn't make it right the first time and have to debug your code, but when it comes to ranking, the only thing that mattered is the time it takes to get a right answer. But I agree that competitive programming can be a great exercise. Not just for the algorithm, but also for everything around the algorithm. For instance, you don't have time to waste parsing a list of integers. You have to get these parts right the first time almost without thinking, so that you can focus on the hard parts, like the algorithm. For example, if you are not confident that you parsed the input data correctly, you will lose time trying to figure out if you algorithm was wrong or if you fed it the wrong data.
- aiunboxed 3y agoTop coder, codeforces, they have penalties for wrong submissions right ?
- baobabKoodaa 3y agoCorrect. In fact I'm having trouble thinking up a single counter example of an algorithm competition that doesn't give penalty for failed submissions.
- mynameismon 3y agoThe Informatics Olympiads?
- tylerhou 3y agoUSACO
- hnfong 3y agoThe way they describe it: > and you obviously lose time when you didn't make it right the first time and have to debug your code, but when it comes to ranking, the only thing that mattered is the time it takes to get a right answer It seems possible this might be ICPC as well... I mean there is a time penalty, but it's still consistent with the literal wording of the description quoted above.
- baobabKoodaa 3y agoI'm not sure if you're making some kind of weird pedantic point, or if you're just mistaken. The ICPC rules state "20 penalty minutes for every previously rejected run for that problem that was not rejected due to Compilation Error". The quote you referenced claimed "the only thing that mattered is the time it takes to get a right answer". Clearly the only thing that matters is not the time it takes to get a right answer: someone who gets the right answer with 1 failed submission and 30 minutes will end up behind someone else who gets the right answer with 0 failed submissions and 40 minutes.
- JohnKemeny 3y agoWhile there often is no penalty for a wrong submission, the score you get for a correct submission very often depends on the number of attempts you needed. E.g. ICPC, topcoder, ...
- jprete 3y agoIsn’t that the same as a penalty? Unless there’s a big category of submissions that are neither right nor wrong….
- JohnKemeny 3y agoNo, it's not the same. You only get the "penalty" if you actually manage to solve the problem in the end. It's a significant difference.
- baobabKoodaa 3y agoIt seems to me that people in this thread are being incredibly pedantic.
- ahoka 3y agoI don’t doubt it is a very good skill to have, but have you found it making any bad habits? Like always having an external oracle you can rely on to tell your solution is correct or getting used to problems having a “right” solution?
- raincole 3y agoThis orcale exists for real world programming jobs. It's called <s>beta users</s> QA.
- aiunboxed 3y agoBad habits, not the one you mentioned but sometimes I feel that same time invested in software development might have yielded better results. In software development you also have test cases where your code should pass so you have in CP
- deleted 3y ago[deleted]
- champagnepapi 3y agoAny resources to get started with competitive programming? For someone who has years of SWE experience, but 0 with competitive programming.
- mrits 3y agoThe same as interviewing resources. this series is a good start: https://www.youtube.com/watch?v=DKCbsiDBN6c https://www.youtube.com/watch?v=DKCbsiDBN6c
- JohnKemeny 3y agoDo Advent of Code! It's great fun. Invite your friends and colleagues to participate too, and make your own scoreboard.
- hnfong 3y agoI'd say just try it out and see how you feel. If you feel defeated and discouraged, then that's the end of it :) However, if you feel motivated to get better results, then you'll find the info you want easily (esp. how to solve the problem[s] that tripped you up) IPSC ( https://ipsc.ksp.sk/ https://ipsc.ksp.sk/ ) used to be my favorite until they stopped organizing it :'( - but you can still play with the problems and see how you would rank :) I would advise against reading a bunch of materials first before you do your first contest -- a lot of those stuff are niche and probably doesn't feel different from leetcode grinding, so only do as much as you feel motivated to read and practice.