Skip to content

This repository contains code solutions to Kattis (online judge) problems which I had solved.

Notifications You must be signed in to change notification settings

leegengyu/Kattis-Solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 

Repository files navigation

Kattis-Solutions

I started working on Kattis problems in mid-December 2017, during the break after my first semester in university. My aim at that point in time was to retain what I've learnt for in my C programming classes (in CS1010 module) earlier in the year, and also to prepare for my next programming module (CS2040C).

I found out about online judges such as Kattis and uVa as they were being used by Dr. Steven Halim (senior lecturer of NUS), who would be teaching me C++ in CS2040C. I wished I had knew about them earlier (in CS1010) because I felt that I lacked adequate practice given the limited number of practices in that module. In light of which, I had decided to publish my code on Github to share with everyone not only about the existence (and usefulness) of online judges (if you had arrived here via a search engine you should've known the former already), but more importantly the code behind the problems.

Besides the basics of indentation, I place emphasis on having spaces between characters where deemed fit, not only due to readability for myself, but also those for my code (spacing it out allows me to have a clearer view too and prevents straining of eyes). At the same time, I aim to have a healthy balance with the length of the code as well, trying to keep it as short (yet readable) as possible. This forces me to think of the problems in a fresh light (how can I do this better? how can I optimise the existing algorithm?) in particular. From time to time I may re-visit old problems as I believe that new insights may be gained after working on newer problems too.

I strongly recommend getting Dr. Steven Halim's Competitive Programming book (CP3), if one has some foundation of programming and is studying programming cum data structures and algorithm. After one semester of learning C language from scratch, I feel that the book has a lot to offer to everyone, including an amateur like myself. What's important is an openness to constant learning! :)

I do take reference from his website when I am stuck at a problem for too long, or when I'm exploring other ways of solving a problem as well. The website groups problems methodically, and provides hint for virtually every problem solved by him and his brother (Dr. Felix Halim) on Kattis and uVa online judge, which I find to be extremely helpful for learning.

  • As codes for these online judge questions do not require up-keeping, 'using namespace std' is used across all of them.
  • To be updated to README for UVa: I realised that using g++ -std=c++11 (ie compiling with a newer version of g++ compiler) means automatic inclusion of certain libraries such as algorithm, and thus, I will not include additional details (such as libaries that are included by the compiler) in my code.

Problems

Problem Languages 🔗
4 thought C++ :cat:
Aaah! C :cat:
ABC C++, C :cat:
Above Average C++ :cat:
A Classy Problem C++ :cat:
ACM Contest Scoring C :cat:
A Different Problem C++ :cat:
All Pairs Shortest Path C++ :cat:
Alphabet Spam C :cat:
A New Alphabet C :cat:
Another Brick in the Wall C++ :cat:
Another Candies C++ :cat:
Anthony and Diablo C :cat:
Ants C++ :cat: [6th Overall]
Apaxiaaaaaaaaaaaans! C++, C :cat:
A Rational Sequence 2 C++ :cat:
A Real Challenge C :cat:
Army Strength (Easy) C++ :cat:
Army Strength (Hard) C++ :cat: [5th Overall]
Autori C :cat:
Babelfish C++ :cat:
Backspace C++ :cat:
Bacon, Eggs, and Spam C++ :cat:
Baloni C++ :cat:
Bard C++ :cat:
Batter Up C :cat:
Battle Simulation C++ :cat:
Beavergnaw C :cat:
Bela C :cat:
Best Relay Team C :cat:
Bijele C :cat:
Binary search tree C++ :cat:
Boat Parts C++ :cat:
Booking a Room C++, C :cat:
Bounding Robots C++ :cat:
Bus C :cat:
Bus Numbers C++ :cat:
Candy Division C++ :cat:
CD C++ :cat:
Cetvrta C :cat:
Character Development C++ :cat:
Closing the Loop C++ :cat:
Cold-puter Science C :cat:
Compound Words C++ :cat:
Conformity C++ :cat:
Counting Stars C++ :cat:
Credit Card Payment C :cat:
Cryptographer's Conundrum C :cat:
Cudoviste C :cat:
Darts C++ :cat:
Datum C :cat:
Death Knight Hero C :cat:
Detailed Differences C :cat:
Dice Cup C :cat:
Dice Game C :cat:
Different Distances C :cat:
DRM Messages C :cat:
Dyslectionary C++ :cat:
Eligibility C++, C :cat:
Encoded Message C++ :cat:
Erase Securely C++ :cat:
Esej C++ :cat:
Estimating the Area of a Circle C :cat:
Event Planning C++ :cat:
Even Up Solitaire C++ :cat:
Faktor C++, C :cat:
Fast Food Prizes C++ :cat:
Filip C :cat:
FizzBuzz C :cat:
Friday the 13th C :cat:
Game of Throwns C++ :cat:
Game Rank C++ :cat:
Grandpa Bernie C++ :cat:
Grass Seed Inc. C :cat:
Greedily Increasing Subsequence C++ :cat: [3rd Overall]
Guess the Number C++ :cat:
Hanging Out on the Terrace C :cat:
Hardware C++ :cat:
Height Ordering C++ :cat:
Heliocentric C++ :cat:
Hello World! C++, C :cat:
Help a PhD candidate out! C :cat:
Herman C :cat:
Hiding Places C++ :cat:
Hissing Microphone C :cat:
I Can Guess the Data Structure! C++ :cat:
ICPC Awards C :cat:
Integer Lists C++ :cat:
Islands C++ :cat:
I've Been Everywhere, Man C :cat:
Judging Moose C++, C :cat:
Just a Minute C++ :cat:
Karte C :cat:
Kemija C :cat:
Kitten on a Tree C++ :cat:
Kornislav C++, C :cat:
Ladder C :cat:
Left Beehind C++, C :cat:
Line Them Up C++ :cat:
Marko C++ :cat:
Meow Factor C++ :cat:
Mia C++, C :cat:
Minimum Scalar Product C++ :cat:
Mirror Images C :cat:
Mixed Fractions C :cat:
Mjehuric C++, C :cat:
Modulo C :cat:
Mosquito Multiplication C :cat:
Nasty Hacks C :cat:
Nine Knights C :cat:
No Duplicates C :cat:
Number Fun C++ :cat:
Numbers On a Tree C++ :cat:
Odd Gnome C :cat:
Oddities C++, C :cat:
Odd Man Out C :cat:
One Chicken Per Person! C++, C :cat:
Pachyderm Peanut Packing C++ :cat:
Paradox With Averages C++ :cat:
Paradox With Averages (Hard) C++ :cat:
Parking C++ :cat:
Parking C++ :cat:
Paul Eigon C :cat:
Peragrams C++ :cat:
Permuted Arithmetic Sequence C++ :cat:
Pervasive Heart Monitor C :cat:
Pet C :cat:
Pizza Crust C :cat:
Planina C :cat:
Planting Trees C :cat:
Popular Vote C++ :cat:
Pot C :cat:
Primary Register C :cat:
Printing Costs C++ :cat:
Prsteni C++ :cat:
Ptice C :cat:
Pub-lic Good C++ :cat:
Quadrant Selection C :cat:
Quick Brown Fox C :cat:
Quick Estimates C :cat:
Quite a Problem C :cat:
R2 C++, C :cat:
Racing Around the Alphabet C++ :cat:
Railroad C :cat:
Reachable Roads C++ :cat:
Reversed Binary Numbers C :cat:
Reversed Rot C :cat:
Riječi C :cat:
Rock-Paper-Scissors Tournament C++ :cat:
Roll Call C++ :cat:
Room Painting C++ :cat:
Running MoM C++ :cat:
Secret Message C++ :cat:
Secure Doors C :cat:
Server C++, C :cat:
Seven Wonders C :cat:
Shopaholic C++ :cat:
Sibice C :cat:
Sideways Sorting C :cat:
Sierpiński Circumference C :cat:
Simon Says C :cat:
Simon Says C :cat:
Simple Addition C++ :cat:
Single source shortest path, negative weights C++ :cat:
Single source shortest path, non-negative weights C++ :cat:
Skener C :cat:
Skocimis C :cat:
Soda Surpler C :cat:
Sok C++ :cat:
Solving for Carrots C :cat:
Sort of Sorting C :cat:
Soylent C :cat:
Spavanac C :cat:
Speed Limit C :cat:
Stacking Cups C :cat:
Stand on Zanzibar C :cat:
Star Arrangements C :cat:
Statistics C++ :cat:
Stuck In A Time Loop C++, C :cat:
Sum Kind of Problem C :cat:
Sum of the Others C++ :cat:
Symmetric Order C++, C :cat:
Synchronizing Lists C++ :cat: [9th Overall]
T9 Spelling C :cat:
Tajna C++ :cat:
Take Two Stones C :cat:
Tarifa C :cat:
Texture Analysis C :cat:
The Amazing Human Cannonball C :cat:
The Easiest Problem Is This One C :cat:
The Key to Cryptography C :cat:
Time Travelling Temperatures C :cat:
ToLower C++ :cat:
Touchscreen Keyboard C++ :cat:
Treasure Hunt C :cat:
Tri C :cat:
Trik C :cat:
Troll Hunt C :cat:
Un-bear-able Zoo C :cat:
Vauvau C :cat:
Veci C++ :cat:
Volim C :cat:
What does the fox say? C++ :cat:
Where's my Internet?? C++ :cat:
Yin and Yang Stones C :cat:
Zamka C++, C :cat:
Zipf's Song C++ :cat:

About

This repository contains code solutions to Kattis (online judge) problems which I had solved.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published