My solutions for Kattis problems. Not all of them have been archived here yet because I haven't bothered scraping through all my submissions from 2022 till now. Solutions are named "problemname".<languagefilename>
. To find the problem statement, please go to:
https://nus.kattis.com/problems/"problemname"
or https://open.kattis.com/problems/"problemname"
Problems are grouped by NUS course categorizations and a separate open category for non-NUS course problems. Some courses share several problems, you might be able to find them under any one of the categories. I generally use C++ unless the NUS course requires otherwise (language requirements found below). I switch to Python if I require big integer operations or if the solution is much shorter and simpler implementation-wise.
-
NUS:
-
CS2040/CS2040C/CS2040S/IT5003 Data Structures & Algorithms: C++ (CS2040C)/Java (CS2040, CS2040S)/Python (IT5003)
-
CS3230 Design and Analysis of Algorithms: C++/Java/Python
-
CS3233 Competitive Programming: C++/Java/Python
-
CS4234 Optimization Algorithms: C++/Java/Python
-
Kattis compiles using C++ 20 for C++, Java 17 for Java and Python 3.10 for Python.
Problems have to be solved using base programming language libraries or self-coded structures. External libraries, such as Boost for C++, Guava for Java, NumPy for Python 3 and others are not available. However, you are allowed to attach multiple files in one submission, although I never bothered.
My code isn't particularly optimized. I do try to come up with efficient solutions to the problems that don't just scrape by the time or memory limit (I also do not like to overallocate memory just for speed), but I've been prioritising coding style as I want my code to be pleasant to read (with some exceptions because I do get lazy sometimes).
Occasionally when I learn new techniques, I do revisit some old solutions of mine to see if I can improve them, so I do update my old code (provided I do remember that problem).
Many of these solutions were implemented after reading the editorials, and I suggest you to do the same if you find yourself stuck. If you have any questions about a particular solution, please contact me at [email protected].