Hi Louis!

I am relatively new to competitive programming and GCJ as well and have
asked myself the same or similar questions. I will do my best to answer
your questions in a way that I found useful and will hopefully steer your
in the right direction.

1) Unfortunately, there seems to be no "one stop shop" for popular/useful
algorithms written in any given language. My guess as to the reason for
this is that, while an algorithm can be used to solve many different
problems, a program is written to solve one specific problem. If you are
looking for this type of reference as a baseline, I would explore
textbooks/courses centered around algorithms with a focus on python. The
route that I took is a bit more time-consuming, but it was free, and I did
not have to look very far. As I am sure that you have seen, you can find
archived solutions written by some of the top performers to previous
problems. I browsed the solutions, found one in my preferred language
(C++), and stepped through it line-by-line making notes on each step until
I had a grasp of the algorithm and its workings in C++. I'll stress again
that this method is useful for understanding how to apply an algorithm to a
problem, not to fully grasp the algorithm itself. I researched algorithms
individually as I found fit. I'll leave a link below to some commented
solutions of previous problems. The solutions are written in C++, however
you may find the comments useful to get an understanding of the solutions'
workings.

2) It is possible to do well using Python. Some of the top performances are
submitted from competitors using Python. However, as you may have also
seen, the majority of competitors use C++. The reason for this is that GCJ
is about creating algorithmic solutions to problems, but it is also about
choosing the right language in which to do so. As a C++ programmer myself,
I learned a bit of Python in order to solve a problem that required the use
of Big Integers, a feature not readily available to me in C++. I do not
know what you mean by "do really well," so I will leave it at this: if you
want to win, you have to use an OOP language like C++. That may not be
true, but when it comes your ability create a wide range of solutions, C++
far outweighs Python simply due to the fact that you have more freedom and
control with C++. On the other hand, if you want to learn the best ways to
solve complex problems using Python regardless of the outcome of the
competition, by all means, use Python, and you will still be able to
compete in some of the live rounds.

3) I'm not much of a reader, so maybe there is somebody else out there that
may have a good solution. Most of my exposure to competitive programming
content comes from online videos, and there are two types that I find
useful. There is the type of video the consists of a competitive programmer
solving problems with no commentary. I find these useful simply because I
admire their ability to take a problem and derive a solution in minutes,
sometimes seconds. It's unbelievable to me that they can get there that
quickly, and it is motivating to see. The second type of videos is the type
that consists of a competitive programmer reviewing problems with
commentary. These are much more drawn out, but they go in depth with
regards to how they go from a problem to a solution in the minutes or
seconds that we saw in the last type. They take you step by step through
how their decisions when creating a solution.

4) C++ does not have these algorithms and libraries readily available. The
reason that most solutions use C++ is that programmers have the ability to
*create* these algorithms and libraries from scratch. As I mentioned
before, you have so much more freedom with an OOP language like C++ with
respect to Python which allows you to solve many more problems if you know
how to approach them.

I hope this helped, and if anybody else out there has anything to add or
thinks that they know a better way to answer any of these questions (you
probably do), please add to this thread. As someone who is also relatively
new to the game, I would love to hear from some of the more experienced lot!

Best,
Matt

On Tue, May 12, 2020 at 5:12 PM Louis-Francois Preville-Ratelle <
[email protected]> wrote:

> I have a few questions concerning competitive programming and the GCJ in
> particular. I, unfortunately, know only how to use Python.
>
> Do you know a place where I can find very fast code (and simple to modify
> if possible) for most algorithms and data structures like maximum matching
> in bipartite graph and others in Python? I would like to use them to solve
> problems for the GCJ. As a specific example, for the GCJ 2019 round 2
> problem 3, you have to use an algo to find maximum bipartite matching. But
> on the server, the hopcroftkarp library doesn’t work. So what should I use
> instead? Please note that I have a lot of experience in math, but
> unfortunately, I am new to competitive programming and I know very little
> about it. I am trying to become more efficient at writing code for
> competitive programming and do code reuse as much as possible instead of
> writing everything from scratch. Even if I know the solution, I am quite
> bad at implementing it fast.
>
> Also, Python seems sometimes on the slow side for GCJ. As an example, for
> the GCJ 2018 round 2 problem 2, my Python solution would work with a bound
> of 470 but not the 500 as demanded. Is it possible to do really well at the
> GCJ using only Python or are you at a significant disadvantage?
>
> It might seem evident, but do you have a good reference (maybe a book) for
> competitive programming (especially the GCJ but also for competitions that
> look like interviews for big tech companies)?
>
> Just by curiosity, does C++ have the algorithms and data structures
> libraries mentioned above that are easy and fast to use in competitive
> programming? I wish I would know it since all the best performers at GCJ
> seem to use only C++.
>
> I apologize for these very basic questions. It seems not so easy to find
> this information online for competitive programming.
>
> Thanks a lot for your time,
> Louis-François
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/be1c6220-7645-456e-b984-bc249aa749ab%40googlegroups.com
> <https://groups.google.com/d/msgid/google-code/be1c6220-7645-456e-b984-bc249aa749ab%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CABb27eTZ1XrddZ5Sx6BpsLQnO4enjRaSp9H-FdX%3Dr%3DJOYbobow%40mail.gmail.com.

Reply via email to