Methods to Solve

(back to Competitive Programming Book website)

Dear Visitor,

If you arrive at this page because you are (Google-)searching for hints/solutions for some of these 2.95K+ UVa/Kattis online judge problems and you do not know about "Competitive Programming" text book yet, you may be interested to get one copy where I discuss the required data structure(s) and/or algorithm(s) for those problems :). Alternatively, you can also visit my other tool VisuAlgo (free) for animated explanations of some of those data structure(s) and/or algorithm(s).

If you arrive at this page because of CP3 (published 24 May 2013), please notice that this page contains the most up-to-date version of CPbook problem classification at UVa or uHunt pages (dubbed CP3.19a++, information is up to date as of 15 May 2019). The major update is the inclusion of ~1K+ Kattis online judge problems on top of the ~2K UVa online judge problems (there are some overlap, around 90+, search substring "also available at Kattis" / "also available at UVa" to find such problems).

Also, if you are a Google Chrome and Kattis user, use this nice Kattis Hint Giver created by one of my student Lin Si Jie that integrates this page directly with Kattis problems pages (you may want to occassionally 'Remove from Chrome' and re-'Add to Chrome' to manually sync this Methods to Solve content with the local cache).

Regards,
Dr Steven Halim, NUS ICPC head coach, ICPC Asia Singapore Regional Contest Director, Singapore IOI team leader, IOI 2020 Deputy Chairman.

Btw, browsing these ~3K problems may feel daunting for beginners, so feel free to use the following filters:

  1. NUS CS1010/E/S/CS1101S : (Basic) Programming Methodology level: I/O, Sequence, Selection, Repetition, Control Flow, Function, Easy Problems, 1D/2D Array, Simple Sorting, Binary Search, Basic Math, Basic String
  2. NUS CS2040/C/S : (Basic) Data Structures and Algorithms level: 1D/2D Array/Vector, Sorting, Linked List, Binary Heap, Hash Table, Binary Search Tree, Graph DS, Graph Traversal, SSSP
  3. NUS CS3230 : Design and Analysis of Algorithms level: Sorting (Harder), BF, D&C (+MatPow, Closest Pair), Greedy, DP (+APSP, Combinatorics, DP String), MST (+Union-Find), SSSP (Harder), String Matching, Convex Hull, NP-hard Problems
  4. NUS CS4234 : Optimisation Algorithms level: Complete Search (small instances), DP (esp Pseudo-Polynomial versions), NP-hard Problems, Max Flow, Graph Matching (+Weighted MCBM), Linear Programming
  5. CP3.19a, "Chapter 1 : Introduction" starred problems only or CP3.19a, all Chapter 1 problems
  6. CP3.19a, "Chapter 2 : Data Structures and Libraries" starred problems only or CP3.19a, all Chapter 2 problems
  7. CP3.19a, "Chapter 3 : Problem Solving Paradigms" starred problems only or CP3.19a, all Chapter 3 problems
  8. CP3.19a, "Chapter 4 : Graph" starred problems only or CP3.19a, all Chapter 4 problems
  9. CP3.19a, "Chapter 8 : More Advanced Topics" starred problems only or CP3.19a, all Chapter 8 problems
  10. Only starred problems from all chapters
  11. If no (or wrong) filter is specified, we will list down all problems, including all those uncategorized 'non-starred' problems (for NUS CS3233/ICPC: Competitive Programming level)

Problem Title CP3.19a++
Fetching from uHunt 1.4d, Game (Others), Harder
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4d, Game (Others), Harder
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4h, Time, Harder
Fetching from uHunt 1.4h, Time, Harder
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.4a, Game (Card)
Fetching from uHunt 1.4h, Time, Harder
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4d, Game (Others), Harder
Fetching from uHunt 1.4d, Game (Others), Harder
Fetching from uHunt 1.4d, Game (Others), Harder
Fetching from uHunt 1.4b, Game (Chess)
Fetching from uHunt 1.3d, Control Flow
Fetching from uHunt 1.4b, Game (Chess)
Fetching from uHunt 1.4h, Time, Harder
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4d, Game (Others), Harder
Fetching from uHunt 1.4c, Game (Others), Easier
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.4d, Game (Others), Harder
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4a, Game (Card)
Fetching from uHunt 1.4c, Game (Others), Easier
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4a, Game (Card)
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 1.4d, Game (Others), Harder
Fetching from uHunt 1.4h, Time, Harder
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.4d, Game (Others), Harder
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 1.4b, Game (Chess)
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4c, Game (Others), Easier
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.3c, Repetition Only
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 1.3d, Control Flow
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.3e, Function
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.3e, Function
Fetching from uHunt 1.4h, Time, Harder
Fetching from uHunt 1.3a, I/O + Sequence Only
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4c, Game (Others), Easier
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.4b, Game (Chess)
Fetching from uHunt 1.4a, Game (Card)
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4c, Game (Others), Easier
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4b, Game (Chess)
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.4a, Game (Card)
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 1.4h, Time, Harder
Fetching from uHunt 1.4d, Game (Others), Harder
Fetching from uHunt 1.4h, Time, Harder
Fetching from uHunt 1.4a, Game (Card)
Fetching from uHunt 1.4c, Game (Others), Easier
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.3e, Function
Fetching from uHunt 1.4d, Game (Others), Harder
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.4c, Game (Others), Easier
Fetching from uHunt 1.3e, Function
Fetching from uHunt 1.4a, Game (Card)
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 1.4d, Game (Others), Harder
Fetching from uHunt 1.4b, Game (Chess)
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4d, Game (Others), Harder
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 1.4h, Time, Harder
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 1.4d, Game (Others), Harder
Fetching from uHunt 1.3c, Repetition Only
Fetching from uHunt 1.3e, Function
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4a, Game (Card)
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.3e, Function
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 1.3d, Control Flow
Fetching from uHunt 1.4c, Game (Others), Easier
Fetching from uHunt 1.4b, Game (Chess)
Fetching from uHunt 1.3d, Control Flow
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.3c, Repetition Only
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 1.3a, I/O + Sequence Only
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 1.4a, Game (Card)
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 1.3e, Function
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.3d, Control Flow
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.3a, I/O + Sequence Only
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.4h, Time, Harder
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.4c, Game (Others), Easier
Fetching from uHunt 1.4a, Game (Card)
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 1.3d, Control Flow
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.4a, Game (Card)
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 1.4f, Real Life, Harder
Fetching from uHunt 1.3d, Control Flow
Fetching from uHunt 1.4h, Time, Harder
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 1.3a, I/O + Sequence Only
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.4i, Time Waster
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.4h, Time, Harder
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 1.4a, Game (Card)
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 1.3d, Control Flow
Fetching from uHunt 1.3a, I/O + Sequence Only
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.4e, Real Life, Easier
Kattis - abc 1.3e, Function
Kattis - acm 1.3d, Control Flow
Kattis - anotherbrick 1.3h, Medium
Kattis - armystrengtheasy 1.3f, Easy
Kattis - armystrengthhard 1.3f, Easy
Kattis - artichoke 1.3e, Function
Kattis - asciiaddition 1.4i, Time Waster
Kattis - averagespeed 1.4i, Time Waster
Kattis - babybites 1.3d, Control Flow
Kattis - batterup 1.3f, Easy
Kattis - battleship 1.4d, Game (Others), Harder
Kattis - battlesimulation 1.3h, Medium
Kattis - beatspread 1.4e, Real Life, Easier
Kattis - beekeeper 1.3h, Medium
Kattis - bela 1.4a, Game (Card)
Kattis - bijele 1.4b, Game (Chess)
Kattis - bitsequalizer 1.3h, Medium
Kattis - bossbattle 1.3g, Still Easy
Kattis - bottledup 1.3h, Medium
Kattis - boundingrobots 1.3g, Still Easy
Kattis - bubbletea 1.3g, Still Easy
Kattis - busyschedule 1.4h, Time, Harder
Kattis - calories 1.4e, Real Life, Easier
1.3h, Medium
Kattis - carrots 1.3a, I/O + Sequence Only
Kattis - cetiri 1.3b, Selection Only
Kattis - chess 1.4b, Game (Chess)
Kattis - chopin 1.4e, Real Life, Easier
Kattis - codecleanups 1.3h, Medium
Kattis - cold 1.3d, Control Flow
Kattis - combinationlock 1.3e, Function
Kattis - compass 1.4e, Real Life, Easier
Kattis - connectthedots 1.4c, Game (Others), Easier
Kattis - creditcard 1.4f, Real Life, Harder
Kattis - datum 1.4g, Time, Easier
Kattis - deathtaxes 1.3g, Still Easy
Kattis - different 1.3b, Selection Only
Kattis - driversdilemma 1.3g, Still Easy
Kattis - dst 1.4h, Time, Harder
Kattis - earlywinter 1.3d, Control Flow
Kattis - eligibility 1.3b, Selection Only
Kattis - empleh 1.4b, Game (Chess)
Kattis - eventplanning 1.3g, Still Easy
Kattis - exactlyelectrical 1.3g, Still Easy
Kattis - faktor 1.3a, I/O + Sequence Only
Kattis - fastfood 1.3h, Medium
Kattis - fbiuniversal 1.4e, Real Life, Easier
Kattis - filip 1.3e, Function
Kattis - friday 1.4g, Time, Easier
Kattis - froggie 1.4i, Time Waster
Kattis - functionalfun 1.4i, Time Waster
Kattis - gamerank 1.4c, Game (Others), Easier
Kattis - glitchbot 1.4i, Time Waster
Kattis - guessinggame 1.4c, Game (Others), Easier
Kattis - hangingout 1.3f, Easy
Kattis - heartrate 1.4e, Real Life, Easier
Kattis - hello 1.3a, I/O + Sequence Only
Kattis - helpaphd 1.3b, Selection Only
Kattis - helpme 1.4b, Game (Chess)
Kattis - hissingmicrophone 1.3f, Easy
Kattis - interpreter 1.4i, Time Waster
Kattis - isithalloween 1.3b, Selection Only
Kattis - jobexpenses 1.3d, Control Flow
Kattis - judgingmoose 1.3b, Selection Only
Kattis - justaminute 1.4g, Time, Easier
Kattis - karte 1.4a, Game (Card)
Kattis - leftbeehind 1.3b, Selection Only
Kattis - licensetolaunch 1.3d, Control Flow
Kattis - luhnchecksum 1.4f, Real Life, Harder
Kattis - marswindow 1.4g, Time, Easier
Kattis - measurement 1.4e, Real Life, Easier
Kattis - memorymatch 1.4d, Game (Others), Harder
Kattis - mia 1.3e, Function
Kattis - mosquito 1.3c, Repetition Only
Kattis - musicalscales 1.4f, Real Life, Harder
Kattis - nastyhacks 1.3b, Selection Only
Kattis - natrij 1.4g, Time, Easier
Kattis - numberfun 1.3b, Selection Only
Kattis - oddgnome 1.3d, Control Flow
Kattis - oddities 1.3b, Selection Only
Kattis - onechicken 1.3b, Selection Only
Kattis - pachydermpeanutpacking 1.4i, Time Waster
Kattis - parking 1.4e, Real Life, Easier
Kattis - peasoup 1.3g, Still Easy
Kattis - pokerhand 1.3f, Easy
Kattis - prerequisites 1.3g, Still Easy
Kattis - printingcosts 1.4i, Time Waster
Kattis - provincesandgold 1.3b, Selection Only
Kattis - ptice 1.3f, Easy
Kattis - qaly 1.3c, Repetition Only
Kattis - quadrant 1.3b, Selection Only
Kattis - r2 1.3a, I/O + Sequence Only
Kattis - recipes 1.4e, Real Life, Easier
Kattis - rockpaperscissors 1.4d, Game (Others), Harder
Kattis - rockscissorspaper 1.4d, Game (Others), Harder
Kattis - romans 1.3a, I/O + Sequence Only
Kattis - savingdaylight 1.4g, Time, Easier
Kattis - saxophone 1.4f, Real Life, Harder
Kattis - semafori 1.4h, Time, Harder
Kattis - sevenwonders 1.3f, Easy
Kattis - shatteredcake 1.3h, Medium
Kattis - shuffling 1.4a, Game (Card)
Kattis - sok 1.3g, Still Easy
Kattis - spavanac 1.4g, Time, Easier
Kattis - speedlimit 1.3c, Repetition Only
Kattis - stararrangements 1.3d, Control Flow
Kattis - statistics 1.3d, Control Flow
Kattis - tarifa 1.3c, Repetition Only
Kattis - temperature 1.3b, Selection Only
Kattis - tictactoe2 1.4d, Game (Others), Harder
Kattis - timeloop 1.3c, Repetition Only
Kattis - timezones 1.4h, Time, Harder
Kattis - toilet 1.4f, Real Life, Harder
Kattis - touchscreenkeyboard 1.4f, Real Life, Harder
Kattis - trainpassengers 1.4e, Real Life, Easier
Kattis - treasurehunt 1.3e, Function
Kattis - trik 1.4c, Game (Others), Easier
Kattis - turtlemaster 1.4d, Game (Others), Harder
Kattis - volim 1.3f, Easy
Kattis - vote 1.3g, Still Easy
Kattis - wertyu 1.4e, Real Life, Easier
Kattis - windows 1.4i, Time Waster
Kattis - wordcloud 1.4f, Real Life, Harder
Kattis - workout 1.4f, Real Life, Harder
Kattis - yinyangstones 1.3f, Easy
Kattis - zanzibar 1.3d, Control Flow