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 5.2a, Math Simulation, Easier
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 3.2b, Iterative (Two Nested Loops)
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 1.3d, Control Flow
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 5.2a, Math Simulation, Easier
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 2.2c, Sorting, Easier
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 6.3g, Output Formatting, Easier
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 3.2b, Iterative (Two Nested Loops)
Fetching from uHunt 3.2b, Iterative (Two Nested Loops)
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 3.3a, Binary Search
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 2.2c, Sorting, Easier
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 3.3a, Binary Search
Fetching from uHunt 1.3c, Repetition Only
Fetching from uHunt 5.2a, Math Simulation, Easier
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 3.2b, Iterative (Two Nested Loops)
Fetching from uHunt 1.3d, Control Flow
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 3.2b, Iterative (Two Nested Loops)
Fetching from uHunt 6.3g, Output Formatting, Easier
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.3e, Function
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 3.2b, Iterative (Two Nested Loops)
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 1.3e, Function
Fetching from uHunt 2.2c, Sorting, Easier
Fetching from uHunt 1.3a, I/O + Sequence Only
Fetching from uHunt 3.3a, Binary Search
Fetching from uHunt 2.2c, Sorting, Easier
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 5.2a, Math Simulation, Easier
Fetching from uHunt 1.3e, Function
Fetching from uHunt 3.3a, Binary Search
Fetching from uHunt 6.3g, Output Formatting, Easier
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 1.3e, Function
Fetching from uHunt 3.3a, Binary Search
Fetching from uHunt 3.2b, Iterative (Two Nested Loops)
Fetching from uHunt 3.3a, Binary Search
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 3.3a, Binary Search
Fetching from uHunt 3.2b, Iterative (Two Nested Loops)
Fetching from uHunt 3.3a, Binary Search
Fetching from uHunt 6.3a, Cipher, Easier
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 2.2c, Sorting, Easier
Fetching from uHunt 2.2c, Sorting, Easier
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 2.2c, Sorting, Easier
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 1.3c, Repetition Only
Fetching from uHunt 3.3a, Binary Search
Fetching from uHunt 1.3e, Function
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 3.2b, Iterative (Two Nested Loops)
Fetching from uHunt 6.3a, Cipher, Easier
Fetching from uHunt 2.2c, Sorting, Easier
Fetching from uHunt 1.3e, Function
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 1.3d, Control Flow
Fetching from uHunt 2.2a, 1D Array Manipulation
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 2.2b, 2D Array Manipulation
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 2.2c, Sorting, Easier
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 1.3a, I/O + Sequence Only
Fetching from uHunt 3.3a, Binary Search
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.3f, Easy
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 1.3e, Function
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.4e, Real Life, Easier
Fetching from uHunt 1.3d, Control Flow
Fetching from uHunt 2.2c, Sorting, Easier
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 2.2c, Sorting, Easier
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 3.3a, Binary Search
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.4e, Real Life, Easier
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 2.2c, Sorting, Easier
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 1.3h, Medium
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 3.3a, Binary Search
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 3.2b, Iterative (Two Nested Loops)
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 2.2c, Sorting, Easier
Fetching from uHunt 1.3d, Control Flow
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 6.3g, Output Formatting, Easier
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 1.3d, Control Flow
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 1.3a, I/O + Sequence Only
Fetching from uHunt 3.2b, Iterative (Two Nested Loops)
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.4g, Time, Easier
Fetching from uHunt 2.2c, Sorting, 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 3.2b, Iterative (Two Nested Loops)
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 2.2a, 1D Array Manipulation
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 2.2c, Sorting, Easier
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 2.2c, Sorting, Easier
Fetching from uHunt 6.3a, Cipher, Easier
Fetching from uHunt 1.3b, Selection Only
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 2.2b, 2D Array Manipulation
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 1.3g, Still Easy
Fetching from uHunt 1.3d, Control Flow
Fetching from uHunt 3.2b, Iterative (Two Nested Loops)
Fetching from uHunt 1.3a, I/O + Sequence Only
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 2.2a, 1D Array Manipulation
Fetching from uHunt 2.2c, Sorting, Easier
Fetching from uHunt 1.3f, Easy
Fetching from uHunt 6.3a, Cipher, Easier
Fetching from uHunt 1.4e, Real Life, Easier
Fetching from uHunt 2.2a, 1D Array Manipulation
Kattis - 2048 2.2b, 2D Array Manipulation
Kattis - 8queens 3.2b, Iterative (Two Nested Loops)
Kattis - abc 1.3e, Function
Kattis - acm 1.3d, Control Flow
Kattis - anewalphabet 6.3a, Cipher, Easier
Kattis - anotherbrick 1.3h, Medium
Kattis - antiarithmetic 3.2b, Iterative (Two Nested Loops)
Kattis - armystrengtheasy 1.3f, Easy
Kattis - armystrengthhard 1.3f, Easy
Kattis - artichoke 1.3e, Function
Kattis - babybites 1.3d, Control Flow
Kattis - baloni 2.2a, 1D Array Manipulation
Kattis - batterup 1.3f, Easy
Kattis - battlesimulation 1.3h, Medium
Kattis - beatspread 1.4e, Real Life, Easier
Kattis - beekeeper 1.3h, Medium
Kattis - bestrelayteam 3.2b, Iterative (Two Nested Loops)
Kattis - bitsequalizer 1.3h, Medium
Kattis - blackfriday 3.2b, Iterative (Two Nested Loops)
Kattis - bossbattle 1.3g, Still Easy
Kattis - bottledup 1.3h, Medium
Kattis - boundingrobots 1.3g, Still Easy
Kattis - bubbletea 1.3g, Still Easy
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 - chartingprogress 2.2c, Sorting, Easier
Kattis - chopin 1.4e, Real Life, Easier
Kattis - closestsums 3.2b, Iterative (Two Nested Loops)
Kattis - closingtheloop 2.2c, Sorting, 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 - compromise 2.2b, 2D Array Manipulation
Kattis - conundrum 6.3a, Cipher, Easier
Kattis - cups 2.2c, Sorting, Easier
Kattis - datum 1.4g, Time, Easier
Kattis - deathtaxes 1.3g, Still Easy
Kattis - different 1.3b, Selection Only
Kattis - display 6.3g, Output Formatting, Easier
Kattis - divideby100 2.2a, 1D Array Manipulation
Kattis - downtime 2.2a, 1D Array Manipulation
Kattis - driversdilemma 1.3g, Still Easy
Kattis - earlywinter 1.3d, Control Flow
Kattis - easiest 5.2a, Math Simulation, Easier
Kattis - eligibility 1.3b, Selection Only
Kattis - encodedmessage 6.3a, Cipher, Easier
Kattis - epigdanceoff 2.2b, 2D Array Manipulation
Kattis - erase 2.2a, 1D Array Manipulation
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 - firefly 3.3a, Binary Search
Kattis - flowshop 2.2b, 2D Array Manipulation
Kattis - friday 1.4g, Time, Easier
Kattis - funhouse 2.2b, 2D Array Manipulation
Kattis - golombrulers 3.2b, Iterative (Two Nested Loops)
Kattis - greedilyincreasing 2.2a, 1D Array Manipulation
Kattis - growlinggears 5.2a, Math Simulation, Easier
Kattis - guess 3.3a, Binary Search
Kattis - hangingout 1.3f, Easy
Kattis - heartrate 1.4e, Real Life, Easier
Kattis - height 2.2c, Sorting, Easier
Kattis - hello 1.3a, I/O + Sequence Only
Kattis - helpaphd 1.3b, Selection Only
Kattis - hissingmicrophone 1.3f, Easy
Kattis - imageprocessing 2.2b, 2D Array Manipulation
Kattis - isithalloween 1.3b, Selection Only
Kattis - jobexpenses 1.3d, Control Flow
Kattis - jollyjumpers 2.2a, 1D Array Manipulation
Kattis - judging 2.2c, Sorting, Easier
Kattis - judgingmoose 1.3b, Selection Only
Kattis - justaminute 1.4g, Time, Easier
Kattis - lawnmower 2.2c, Sorting, Easier
Kattis - leftbeehind 1.3b, Selection Only
Kattis - licensetolaunch 1.3d, Control Flow
Kattis - lineup 2.2c, Sorting, Easier
Kattis - marswindow 1.4g, Time, Easier
Kattis - mastermind 2.2a, 1D Array Manipulation
Kattis - measurement 1.4e, Real Life, Easier
Kattis - mia 1.3e, Function
Kattis - mjehuric 2.2c, Sorting, Easier
Kattis - mosquito 1.3c, Repetition Only
Kattis - musicalnotation 6.3g, Output Formatting, Easier
Kattis - nastyhacks 1.3b, Selection Only
Kattis - natrij 1.4g, Time, Easier
Kattis - nineknights 2.2b, 2D Array Manipulation
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 - parking 1.4e, Real Life, Easier
Kattis - peasoup 1.3g, Still Easy
Kattis - peg 3.2b, Iterative (Two Nested Loops)
Kattis - pet 3.2b, Iterative (Two Nested Loops)
Kattis - pivot 2.2a, 1D Array Manipulation
Kattis - pokerhand 1.3f, Easy
Kattis - prerequisites 1.3g, Still Easy
Kattis - provincesandgold 1.3b, Selection Only
Kattis - prva 2.2b, 2D Array Manipulation
Kattis - ptice 1.3f, Easy
Kattis - putovanje 3.2b, Iterative (Two Nested Loops)
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 - reduction 3.2b, Iterative (Two Nested Loops)
Kattis - register 3.2b, Iterative (Two Nested Loops)
Kattis - rings2 2.2b, 2D Array Manipulation
Kattis - rockband 2.2a, 1D Array Manipulation
Kattis - romans 1.3a, I/O + Sequence Only
Kattis - roompainting 3.3a, Binary Search
Kattis - savingdaylight 1.4g, Time, Easier
Kattis - sevenwonders 1.3f, Easy
Kattis - shatteredcake 1.3h, Medium
Kattis - sidewayssorting 2.2c, Sorting, Easier
Kattis - skener 6.3g, Output Formatting, Easier
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 - synchronizinglists 2.2c, Sorting, Easier
Kattis - tarifa 1.3c, Repetition Only
Kattis - telephones 3.2b, Iterative (Two Nested Loops)
Kattis - temperature 1.3b, Selection Only
Kattis - tetris 2.2b, 2D Array Manipulation
Kattis - timeloop 1.3c, Repetition Only
Kattis - tourdefrance 3.2b, Iterative (Two Nested Loops)
Kattis - trainpassengers 1.4e, Real Life, Easier
Kattis - treasurehunt 1.3e, Function
Kattis - trollhunt 5.2a, Math Simulation, Easier
Kattis - volim 1.3f, Easy
Kattis - vote 1.3g, Still Easy
Kattis - wertyu 1.4e, Real Life, Easier
Kattis - yinyangstones 1.3f, Easy
Kattis - zanzibar 1.3d, Control Flow