Use these filters to narrow down your next problem to solve:
OJ: , Topic: , Quality: , Difficulty:
You can now sort these problems based on Distinct ACcepted Users (DACU) column.
Generally, problems with high DACU are the easier problems.
Note that we only update DACU column manually when we first entered the hint (thus an outdated data).
Column Point is only used in Kattis (and simulated in LeetCode) online judge.
| All OJ | Problem Title | CP4+5 | Hint | DACU | Point |
|---|---|---|---|---|---|
| 00750 | Fetching from uHunt | 3.2a, Pre-calculate-able | classic backtracking problem; only 92 possible 8-queens positions | 0.0 | |
| 10128 | Fetching from uHunt | 3.2a, Pre-calculate-able | backtracking with pruning; try all $N!$ permutations that satisfy the requirement; 13! will TLE; pre-calculate the resul... | 0.0 | |
| 10276 | Fetching from uHunt | 3.2a, Pre-calculate-able | insert a number one by one | 0.0 | |
| cardtrick2 |
|
3.2a, Pre-calculate-able | n <= 13, we can simulate the process using queue and precalculate all 13 possible answers | 869 | 1.6 |
| foolingaround |
|
3.2a, Pre-calculate-able | there are only 379 different values of N where Bob wins; pre-calculateable | 117 | 5.8 |
| lc0052 | to replace with LeetCode link soon... | 3.2a, Pre-calculate-able | pre-calculate answers for n = 1 to 9; top-interview-150 | 0 | 6.0 |
| sgcoin |
|
3.2a, Pre-calculate-able | we can either brute force short string message; precompute all possible hash values; or come up with O(1) solution | 271 | 2.4 |
| 12488 | Fetching from uHunt | 3.2b, Iterative (Two Loops), E | 2 nested loops; simulate overtaking process | 0.0 | |
| blackfriday |
|
3.2b, Iterative (Two Loops), E | 2D nested loops; frequency counting | 2384 | 2.2 |
| closestsums |
|
3.2b, Iterative (Two Loops), E | sort and then do O(n^2) pairings; also available at UVa 10487 - Closest Sums | 1105 | 2.9 |
| golombrulers |
|
3.2b, Iterative (Two Loops), E | 2D nested loops; additional 1D loops for checking | 297 | 3.2 |
| lc3184 | to replace with LeetCode link soon... | 3.2b, Iterative (Two Loops), E | 2 nested loops | 0 | 2.0 |
| 01588 | Fetching from uHunt | 3.2c, Iterative (Two Loops), H | LA 3712 - NorthEasternEurope06; good iterative brute force problem; beware of corner cases | 0.0 | |
| 00441 | Fetching from uHunt | 3.2d, Three+ Nested Loops, E | 6 nested loops; easy | 0.0 | |
| 12515 | Fetching from uHunt | 3.2d, Three+ Nested Loops, E | 3 nested loops | 0.0 | |
| 12844 | Fetching from uHunt | 3.2d, Three+ Nested Loops, E | 5 nested loops; scaled down version of UVa 10202; do observations first | 0.0 | |
| cudoviste |
|
3.2d, Three+ Nested Loops, E | 4 nested loops; the inner loops is just 2x2; 5 possibilities of crushed cars; skip 2x2 area that contains building | 1194 | 1.4 |
| lc1790 | to replace with LeetCode link soon... | 3.2d, Three+ Nested Loops, E | 3 nested loops | 0 | 2.0 |
| npuzzle |
|
3.2d, Three+ Nested Loops, E | 4 nested loops; easy | 683 | 2.2 |
| set |
|
3.2d, Three+ Nested Loops, E | 4 nested loops; easy | 364 | 1.8 |
| 00386 | Fetching from uHunt | 3.2e, Three+ Nested Loops, H | 4 nested loops with pruning | 0.0 | |
| 10660 | Fetching from uHunt | 3.2e, Three+ Nested Loops, H | 7 nested loops; Manhattan distance | 0.0 | |
| 11804 | Fetching from uHunt | 3.2e, Three+ Nested Loops, H | 5 nested loops | 0.0 | |
| calculatingdartscores |
|
3.2e, Three+ Nested Loops, H | 6 nested loops but easy; see if a*i +b*j + c*k == n | 752 | 2.8 |
| lc2352 | to replace with LeetCode link soon... | 3.2e, Three+ Nested Loops, H | 3 nested loops solution is still acceptable; leetcode-75 | 0 | 4.0 |
| lektira |
|
3.2e, Three+ Nested Loops, H | 2 nested loops to try all 2 cutting points plus 1 more loop to actually do the reversing of sub words | 376 | 3.2 |
| tautology |
|
3.2e, Three+ Nested Loops, H | try all 2^5 = 32 values with pruning; also available at UVa 11108 - Tautology | 160 | 3.4 |
| 00234 | Fetching from uHunt | 3.2f, Iterative (Permutation) | LA 5173 - WorldFinals Phoenix94; use next_permutation; simulation | 0.0 | |
| 01064 | Fetching from uHunt | 3.2f, Iterative (Permutation) | LA 3808 - WorldFinals Tokyo07; permutation of up to 5 messages; simulation; mind the word 'consecutive' | 0.0 | |
| 11742 | Fetching from uHunt | 3.2f, Iterative (Permutation) | try all permutations | 0.0 | |
| dancerecital |
|
3.2f, Iterative (Permutation) | try all R! permutations; compare adjacent routines | 274 | 4.2 |
| dreamer |
|
3.2f, Iterative (Permutation) | try all 8! permutations of digits; check if the date is valid; output earliest valid date | 406 | 2.0 |
| lc0046 | to replace with LeetCode link soon... | 3.2f, Iterative (Permutation) | C++ next_permutation from sorted to reverse-sorted permutations; top-100-liked; top-interview-150 | 0 | 4.0 |
| veci |
|
3.2f, Iterative (Permutation) | try all permutations; get the one that is larger than X | 1193 | 1.8 |
| 00639 | Fetching from uHunt | 3.2g, Iterative (Combination) | generate 2^(4x4) = 2^16 combinations and prune | 0.0 | |
| 01047 | Fetching from uHunt | 3.2g, Iterative (Combination) | LA 3278 - WorldFinals Shanghai05; try all 2^n subsets of towers to be taken; use inclusion-exclusion principle | 0.0 | |
| 12694 | Fetching from uHunt | 3.2g, Iterative (Combination) | LA 6606 - Phuket13; it is safest to just brute force all 2^20 possibilities; greedy solution should be possible too | 0.0 | |
| geppetto |
|
3.2g, Iterative (Combination) | try all 2^N subsets of ingredients | 305 | 3.3 |
| lc0077 | to replace with LeetCode link soon... | 3.2g, Iterative (Combination) | standard nCk; use itertools.combinations; top-interview-150 | 0 | 4.0 |
| squaredeal |
|
3.2g, Iterative (Combination) | try all 3! permutations of rectangles and try all 2^3 combinations of rectangle orientations; test figure 1.a and 1.b co... | 232 | 4.6 |
| zagrade |
|
3.2g, Iterative (Combination) | try all subsets of bracket pairs to be removed | 298 | 3.1 |
| 00725 | Fetching from uHunt | 3.2h, Try All Answers | try all possible answers | 0.0 | |
| 10908 | Fetching from uHunt | 3.2h, Try All Answers | 4 nested loops; try all possible odd square lengths | 0.0 | |
| communication |
|
3.2h, Try All Answers | try all possible bytes; apply the bitmask formula | 764 | 2.0 |
| flexible |
|
3.2h, Try All Answers | try all possible answers | 2354 | 1.7 |
| islands |
|
3.2h, Try All Answers | try all possible subsets; prune the non-contiguous ones (only 55 valid bitmasks between [0..1023]); check the 'island' p... | 443 | 2.6 |
| lc2843 | to replace with LeetCode link soon... | 3.2h, Try All Answers | create helper function is_symmetric; try all numbers between low..high | 0 | 2.0 |
| walls |
|
3.2h, Try All Answers | try whether the answer is 1/2/3/4; or Impossible; use up to 4 nested loops | 513 | 4.0 |
| 01225 | Fetching from uHunt | 3.2i, Math Simulation, E | LA 3996 - Danang07; N is small | 0.0 | |
| 10346 | Fetching from uHunt | 3.2i, Math Simulation, E | interesting simulation problem | 0.0 | |
| easiest |
|
3.2i, Math Simulation, E | complete search; sum of digit | 3991 | 1.6 |
| growlinggears |
|
3.2i, Math Simulation, E | physics of parabola; derivation; try all gears | 496 | 2.4 |
| lc1823 | to replace with LeetCode link soon... | 3.2i, Math Simulation, E | use Josephus formula | 0 | 4.0 |
| lc2427 | to replace with LeetCode link soon... | 3.2i, Math Simulation, E | try all x; a and b are small | 0 | 2.0 |
| trollhunt |
|
3.2i, Math Simulation, E | brute force; simple | 976 | 2.6 |
| videospeedup |
|
3.2i, Math Simulation, E | brute force; simple for loop; do as asked | 298 | 2.0 |
| lc0970 | to replace with LeetCode link soon... | 3.2j, Math Simulation, M | the values of x^i or y^j will grow fast; search space is small | 0 | 4.0 |
| 00616 | Fetching from uHunt | 3.2k, Math Simulation, H | brute force up to sqrt(n); get pattern | 0.0 | |
| 11130 | Fetching from uHunt | 3.2k, Math Simulation, H | mirror the billiard table to the right (and/or top) so that we will only deal with one straight line instead of bouncing... | 0.0 | |
| 11254 | Fetching from uHunt | 3.2k, Math Simulation, H | use sum of AP; brute force all values of r from sqrt(2n) down to 1; stop at the first valid a | 0.0 | |
| 11490 | Fetching from uHunt | 3.2k, Math Simulation, H | let missing_people = 2*a^2; thickness_of_soldiers = b; derive a formula involving a; b; and the given S | 0.0 | |
| crackingrsa |
|
3.2k, Math Simulation, H | a bit number theory; solvable with complete search | 258 | 2.3 |
| falling |
|
3.2k, Math Simulation, H | rework the formula; complete search up to sqrt(D) | 588 | 3.1 |
| thanosthehero |
|
3.2k, Math Simulation, H | for-loop from backwards | 320 | 3.9 |
| 00151 | Fetching from uHunt | 3.2l, Josephus Problem | the original Josephus problem | 0.0 | |
| 01176 | Fetching from uHunt | 3.2l, Josephus Problem | LA 2346 - Dhaka01; special case when k = 2; use Josephus recurrence; simulation | 0.0 | |
| 11351 | Fetching from uHunt | 3.2l, Josephus Problem | use general case Josephus recurrence | 0.0 | |
| eenymeeny |
|
3.2l, Josephus Problem | Josephus problem; small n; just simulate | 492 | 1.7 |
| musicalchairs |
|
3.2l, Josephus Problem | Josephus variant; brute force | 139 | 4.0 |
| toys |
|
3.2l, Josephus Problem | use general case Josephus recurrence | 142 | 4.5 |
| 10344 | Fetching from uHunt | 3.2m, Backtracking, Easier | 5 operands + 3 operators | 0.0 | |
| 10576 | Fetching from uHunt | 3.2m, Backtracking, Easier | generate all; prune; take max | 0.0 | |
| 12840 | Fetching from uHunt | 3.2m, Backtracking, Easier | simple backtracking | 0.0 | |
| goodmorning |
|
3.2m, Backtracking, Easier | we can use backtracking to generate all possible (small) numbers that can be pressed according to the constraints | 347 | 2.7 |
| lc0017 | to replace with LeetCode link soon... | 3.2m, Backtracking, Easier | classic backtracking; leetcode-75; top-100-liked; top-interview-150 | 0 | 4.0 |
| natjecanje |
|
3.2m, Backtracking, Easier | 4 options for each team with kayak: do nothing, pass to left (if damaged), keep to self (if damaged), pass to right (if ... | 701 | 2.5 |
| paintings |
|
3.2m, Backtracking, Easier | try all possible paintings based on Catherine's preference; skip hideous color pairs | 162 | 3.6 |
| 00208 | Fetching from uHunt | 3.2n, Backtracking, Harder | LA 5147 - WorldFinals SanAntonio91; backtracking with some pruning | 0.0 | |
| 00222 | Fetching from uHunt | 3.2n, Backtracking, Harder | LA 5161 - WorldFinals Indianapolis93; cannot use DP 'tank' is floating-point; use backtracking | 0.0 | |
| 01262 | Fetching from uHunt | 3.2n, Backtracking, Harder | LA 4845 - Daejeon10; sort grid columns; process common passwords in lexicographic order; skip two similar passwords | 0.0 | |
| dobra |
|
3.2n, Backtracking, Harder | try all possible 3^n changes of '_' (to a vowel, an 'L', or other consonant not 'L'); prune invalid states; count valid ... | 44 | 3.9 |
| fruitbaskets |
|
3.2n, Backtracking, Harder | interesting backtracking problem; compute the small numbers < 200; output all minus this value computed via backtrack... | 493 | 4.1 |
| lc0216 | to replace with LeetCode link soon... | 3.2n, Backtracking, Harder | backtracking; bitmask; generate solutions; leetcode-75 | 0 | 4.0 |
| pagelayout |
|
3.2n, Backtracking, Harder | a bit of geometry; O(2^n imes n^2 iterative bitmask will TLE; need to use recursive backtracking with pruning | 84 | 5.1 |
| 11057 | Fetching from uHunt | 3.3a, Binary Search | sort; target pair problem | 0.0 | |
| 11621 | Fetching from uHunt | 3.3a, Binary Search | generate numbers with factor 2 and/or 3; sort; upper_bound | 0.0 | |
| 12965 | Fetching from uHunt | 3.3a, Binary Search | sort producer/consumer prices; the answer is one of the prices mentioned; use binary searches to count the answer | 0.0 | |
| firefly |
|
3.3a, Binary Search | sort stalactites vs stalagmites separately; brute force height; binary search the obstacles hit | 323 | 4.0 |
| lc0162 | to replace with LeetCode link soon... | 3.3a, Binary Search | interesting binary-search modification; leetcode-75; top-interview-150 | 0 | 4.0 |
| outofsorts |
|
3.3a, Binary Search | do O(log n) binary searches on unsorted array n times | 107 | 3.7 |
| roompainting |
|
3.3a, Binary Search | sort the cans at shop (can be used more than once); use lower_bound for what Joe needs at shop | 416 | 3.8 |
| 12190 | Fetching from uHunt | 3.3b, Bisection and BSTA, E | BSTA + algebra | 0.0 | |
| 13142 | Fetching from uHunt | 3.3b, Bisection and BSTA, E | BSTA + Physics simulation | 0.0 | |
| carefulascent |
|
3.3b, Bisection and BSTA, E | BSTA + Physics simulation | 558 | 1.8 |
| freeweights |
|
3.3b, Bisection and BSTA, E | BSTA + simulation; Mathematical observation | 356 | 4.5 |
| lc0875 | to replace with LeetCode link soon... | 3.3b, Bisection and BSTA, E | BSTA + simulation check; leetcode-75 | 0 | 4.0 |
| monk |
|
3.3b, Bisection and BSTA, E | BSTA + simulation; cool | 86 | 3.3 |
| suspensionbridges |
|
3.3b, Bisection and BSTA, E | BSTA + Maths; be careful of precision error | 409 | 4.6 |
| 00183 | Fetching from uHunt | 3.3c, Ternary Search & Others | simple exercise of DnC | 0.0 | |
| 10385 | Fetching from uHunt | 3.3c, Ternary Search & Others | the function is unimodal; ternary search | 0.0 | |
| 12893 | Fetching from uHunt | 3.3c, Ternary Search & Others | convert the given code into recursive DnC | 0.0 | |
| a1paper |
|
3.3c, Ternary Search & Others | division of A1 paper is a kind of DnC principle | 1212 | 3.9 |
| ceiling |
|
3.3c, Ternary Search & Others | LA 7578 - WorldFinals Phuket16; BST insertion then tree equality check; also available at UVa 01738 - Ceiling Function | 1871 | 1.9 |
| goingtoseed |
|
3.3c, Ternary Search & Others | divide to search into four regions; extension of binary/ternary search concept | 199 | 6.3 |
| lc2293 | to replace with LeetCode link soon... | 3.3c, Ternary Search & Others | simulate the game; n halves each level | 0 | 2.0 |
| 01193 | Fetching from uHunt | 3.4a, Greedy (Classical) | LA 2519 - Beijing02; interval covering | 0.0 | |
| 10020 | Fetching from uHunt | 3.4a, Greedy (Classical) | interval covering | 0.0 | |
| 11264 | Fetching from uHunt | 3.4a, Greedy (Classical) | coin change variant | 0.0 | |
| classrooms |
|
3.4a, Greedy (Classical) | variant of interval covering; multiple rooms | 229 | 5.9 |
| froshweek2 |
|
3.4a, Greedy (Classical) | greedy; sort first; similar to Dragon of Loowater; greedy matching | 489 | 2.3 |
| lc0455 | to replace with LeetCode link soon... | 3.4a, Greedy (Classical) | sort; greedy bipartite matching | 0 | 2.0 |
| squarepegs |
|
3.4a, Greedy (Classical) | convert square to circular; sort; greedy matching | 265 | 3.1 |
| 11369 | Fetching from uHunt | 3.4b, Involving Sorting, E | greedy; sorting | 0.0 | |
| 11900 | Fetching from uHunt | 3.4b, Involving Sorting, E | greedy; sorting | 0.0 | |
| 13109 | Fetching from uHunt | 3.4b, Involving Sorting, E | greedy; sorting | 0.0 | |
| icpcteamselection |
|
3.4b, Involving Sorting, E | greedy; sorting | 586 | 3.0 |
| lc1913 | to replace with LeetCode link soon... | 3.4b, Involving Sorting, E | sort; use the last and first two | 0 | 2.0 |
| minimumscalar |
|
3.4b, Involving Sorting, E | one sort increasing; one sort decreasing | 1202 | 2.3 |
| shopaholic |
|
3.4b, Involving Sorting, E | sort prices in descending order, pick every third item | 959 | 2.4 |
| lc0435 | to replace with LeetCode link soon... | 3.4c, Involving Sorting, M | sort by non-decreasing endpoints; greedy; leetcode-75 | 0 | 4.0 |
| lc0452 | to replace with LeetCode link soon... | 3.4c, Involving Sorting, M | sort by non-decreasing endpoints; greedy; leetcode-75; top-interview-150 | 0 | 4.0 |
| lc0881 | to replace with LeetCode link soon... | 3.4c, Involving Sorting, M | sort people by non-dec weights; two pointers: lightest+heaviest; greedy | 0 | 4.0 |
| lc1090 | to replace with LeetCode link soon... | 3.4c, Involving Sorting, M | sort by non-increasing values | 0 | 4.0 |
| lc1282 | to replace with LeetCode link soon... | 3.4c, Involving Sorting, M | sort by non-decreasing size, keep the original indices | 0 | 4.0 |
| lc2895 | to replace with LeetCode link soon... | 3.4c, Involving Sorting, M | sort tasks by non-increasing order and processor time by non-decreasing order | 0 | 4.0 |
| lc3301 | to replace with LeetCode link soon... | 3.4c, Involving Sorting, M | sort by non-increasing maximum height | 0 | 4.0 |
| 12673 | Fetching from uHunt | 3.4d, Involving Sorting, H | LA 6530 - LatinAmerica13; greedy; sorting | 0.0 | |
| 12834 | Fetching from uHunt | 3.4d, Involving Sorting, H | greedy; sorting | 0.0 | |
| 13054 | Fetching from uHunt | 3.4d, Involving Sorting, H | greedy; sorting | 0.0 | |
| airconditioned |
|
3.4d, Involving Sorting, H | greedy; sorting | 1116 | 3.9 |
| birds |
|
3.4d, Involving Sorting, H | greedy; sorting | 566 | 3.5 |
| delivery |
|
3.4d, Involving Sorting, H | sort, process positive and negative delivery separately; go to rightmost, come back and fill as many from the right | 253 | 3.3 |
| lc0055 | to replace with LeetCode link soon... | 3.4d, Involving Sorting, H | for each reachable i, greedily extend the furthest jump, if we can; top-100-liked; top-interview-150 | 0 | 4.0 |
| 01153 | Fetching from uHunt | 3.4e, Involving PQ | greedy; priority queue | 0.0 | |
| 13177 | Fetching from uHunt | 3.4e, Involving PQ | greedy; priority queue | 0.0 | |
| ballotboxes |
|
3.4e, Involving PQ | greedy; priority queue | 776 | 4.4 |
| canvas |
|
3.4e, Involving PQ | PQ simulation; process from N canvases to 1 all-white canvas; take two minimum canvas size; greedy; add them and re-enqu... | 214 | 3.5 |
| lc2542 | to replace with LeetCode link soon... | 3.4e, Involving PQ | sort (nums2[i], nums1[i]) by non-increasing nums2; maintain min PQ of nums1; keep largest k; leetcode-75 | 0 | 4.0 |
| vegetables |
|
3.4e, Involving PQ | store cut lengths as fractions; keep taking the largest portion; greedy; try to cut 1/2,1/3,1/4,etc; re-enqueue the resu... | 347 | 3.4 |
| workstations |
|
3.4e, Involving PQ | greedy; priority queue | 1110 | 3.6 |
| 10656 | Fetching from uHunt | 3.4f, Non-Classical, Easier | greedy | 0.0 | |
| 11520 | Fetching from uHunt | 3.4f, Non-Classical, Easier | greedy | 0.0 | |
| 12482 | Fetching from uHunt | 3.4f, Non-Classical, Easier | greedy | 0.0 | |
| ants |
|
3.4f, Non-Classical, Easier | greedy; also available at UVa 10714 - Ants | 1145 | 2.5 |
| bank |
|
3.4f, Non-Classical, Easier | greedy | 2389 | 2.6 |
| lc0860 | to replace with LeetCode link soon... | 3.4f, Non-Classical, Easier | use 10+5 before 5+5+5; programming-skills | 0 | 2.0 |
| marblestree |
|
3.4f, Non-Classical, Easier | greedy; also available at UVa 10672 - Marbles on a tree | 258 | 3.0 |
| 10821 | Fetching from uHunt | 3.4g, Non-Classical, Harder | greedy | 0.0 | |
| 11491 | Fetching from uHunt | 3.4g, Non-Classical, Harder | greedy | 0.0 | |
| 11583 | Fetching from uHunt | 3.4g, Non-Classical, Harder | greedy | 0.0 | |
| 11890 | Fetching from uHunt | 3.4g, Non-Classical, Harder | greedy | 0.0 | |
| dvds |
|
3.4g, Non-Classical, Harder | greedy | 731 | 2.9 |
| lc0763 | to replace with LeetCode link soon... | 3.4g, Non-Classical, Harder | DAT last occurence of ('a'..'z'); one-pass greedy solution is possible; top-100-liked | 0 | 4.0 |
| stockbroker |
|
3.4g, Non-Classical, Harder | greedy | 578 | 3.4 |
| virus |
|
3.4g, Non-Classical, Harder | greedy | 753 | 3.6 |
| 10684 | Fetching from uHunt | 3.5a, 1D Range Sum | standard; Kadane's algorithm | 0.0 | |
| commercials |
|
3.5a, 1D Range Sum | transform each input by -P; Kadane's algorithm | 1570 | 2.0 |
| lc0053 | to replace with LeetCode link soon... | 3.5a, 1D Range Sum | Kadane's; special case for all negatives; top-100-liked; top-interview-150 | 0 | 4.0 |
| sellingspatulas |
|
3.5a, 1D Range Sum | -8 per time slot initially; read sale data; 1D range sum; complete search | 109 | 8.0 |
| shortsell |
|
3.5a, 1D Range Sum | similar to Kadane's algorithm; linear pass; prefix sum | 104 | 4.1 |
| 01105 | Fetching from uHunt | 3.5b, 2D Range Sum | LA 5132 - WorldFinals Orlando11; more advanced 2D Range Sum Queries | 0.0 | |
| 10755 | Fetching from uHunt | 3.5b, 2D Range Sum | max 2D range sum in 2 of the 3 dimensions; max 1D range sum with Kadane's algorithm on the 3rd dimension | 0.0 | |
| lc0085 | to replace with LeetCode link soon... | 3.5b, 2D Range Sum | after penalising the 0s heavily, this is just max 2D range sum | 0 | 6.0 |
| prozor |
|
3.5b, 2D Range Sum | 2D range sum with fix range; output formatting | 558 | 1.6 |
| 00481 | Fetching from uHunt | 3.5c, LIS | O(n log k) LIS+solution | 0.0 | |
| 01196 | Fetching from uHunt | 3.5c, LIS | LA 2815 - Kaohsiung03; sort all the blocks in increasing L[i]; then we get the classical LIS problem | 0.0 | |
| 11790 | Fetching from uHunt | 3.5c, LIS | combination of LIS LDS; weighted | 0.0 | |
| increasingsubsequence |
|
3.5c, LIS | LIS; n ≤ 200$; print lexicographically smallest solution, 99% similar to 'longincsubseq' | 352 | 4.1 |
| lc0334 | to replace with LeetCode link soon... | 3.5c, LIS | LIS problem with a very small tweak; leetcode-75 | 0 | 4.0 |
| nesteddolls |
|
3.5c, LIS | sort in one dimension; Dilworth's theorem; LIS in the other; also available at UVa 11368 - Nested Dolls | 115 | 7.1 |
| trainsorting |
|
3.5c, LIS | max(LIS(i)+LDS(i)-1), ∀i ∈ [0...n-1]; also available at UVa 11456 | 522 | 5.4 |
| 01213 | Fetching from uHunt | 3.5d, 0-1 KNAPSACK/SS | LA 3619 - Yokohama06; extension of 0-1 KNAPSACK; s: (id, remN, remK) instead of s: (id, remN) | 0.0 | |
| 10130 | Fetching from uHunt | 3.5d, 0-1 KNAPSACK/SS | basic 0-1 Knapsack problem | 0.0 | |
| 11832 | Fetching from uHunt | 3.5d, 0-1 KNAPSACK/SS | interesting DP; s: (id; val); use offset to handle negative numbers; t: plus or minus; print solution | 0.0 | |
| knapsack |
|
3.5d, 0-1 KNAPSACK/SS | basic DP KNAPSACK; print the solution | 687 | 4.8 |
| lc0474 | to replace with LeetCode link soon... | 3.5d, 0-1 KNAPSACK/SS | Knapsack; skip or take a string | 0 | 4.0 |
| orders |
|
3.5d, 0-1 KNAPSACK/SS | interesting KNAPSACK variant; print the solution | 713 | 4.5 |
| presidentialelections |
|
3.5d, 0-1 KNAPSACK/SS | pre-process the input to discard non winnable states; be careful of negative total voters; then standard DP KNAPSACK | 116 | 5.7 |
| 00242 | Fetching from uHunt | 3.5e, COIN-CHANGE | LA 5181 - WorldFinals Nashville95; Complete Search + DP Coin-Change | 0.0 | |
| 00674 | Fetching from uHunt | 3.5e, COIN-CHANGE | basic coin change problem | 0.0 | |
| 11259 | Fetching from uHunt | 3.5e, COIN-CHANGE | part of the problem is DP COIN-CHANGE with restricted number of coins per type; inclusion-exclusion | 0.0 | |
| bagoftiles |
|
3.5e, COIN-CHANGE | count number of ways to do COIN-CHANGE; meet in the middle; DP combinatorics (n choose k) to find the answer for a+b | 102 | 6.5 |
| canonical |
|
3.5e, COIN-CHANGE | complete search possible range of counter examples; do both greedy COIN-CHANGE and DP COIN-CHANGE | 502 | 5.7 |
| exactchange2 |
|
3.5e, COIN-CHANGE | a variation to the Coin-Change problem; also available at UVa 11517 - Exact Change | 708 | 5.4 |
| lc0322 | to replace with LeetCode link soon... | 3.5e, COIN-CHANGE | COIN-CHANGE; top-100-liked; top-interview-150 | 0 | 4.0 |
| 00216 | Fetching from uHunt | 3.5f, TSP | LA 5155 - WorldFinals KansasCity92; DP TSP problem; but still solvable with backtracking | 0.0 | |
| 11795 | Fetching from uHunt | 3.5f, TSP | DP TSP variant; counting paths on DAG; DP+bitmask; let Mega Buster owned by a dummy 'Robot 0' | 0.0 | |
| 12841 | Fetching from uHunt | 3.5f, TSP | simply find and print the lexicographically smallest Hamiltonian path; use DP-TSP technique | 0.0 | |
| beepers |
|
3.5f, TSP | DP or recursive backtracking with sufficient pruning; also available at UVa 10496 - Collecting Beepers | 196 | 4.6 |
| bustour |
|
3.5f, TSP | LA 6028 - WorldFinals Warsaw12; DP TSP variant; also available at UVa 01281 - Bus Tour | 124 | 6.1 |
| cycleseasy |
|
3.5f, TSP | Count number of HAMILTONIAN-TOURs | 108 | 4.1 |
| errands |
|
3.5f, TSP | map location names to integer indices; DP TSP | 51 | 7.0 |
| 01261 | Fetching from uHunt | 3.5g, Non-Classical, 1D, E | LA 4844 - Daejeon10; backtracking possible; but we use a set<string> to prevent recomputation | 0.0 | |
| 11420 | Fetching from uHunt | 3.5g, Non-Classical, 1D, E | s: (prev; id; numlck); lock/unlock this chest | 0.0 | |
| 12654 | Fetching from uHunt | 3.5g, Non-Classical, 1D, E | s: (hole); t: use patch T1 or patch T2 | 0.0 | |
| lc0746 | to replace with LeetCode link soon... | 3.5g, Non-Classical, 1D, E | s: (i); t: to (i+1) or (i+2); Fibonacci variant; leetcode-75 | 0 | 2.0 |
| 10003 | Fetching from uHunt | 3.5h, Non-Classical, 2D, E | discussed in this section | 0.0 | |
| 11450 | Fetching from uHunt | 3.5h, Non-Classical, 2D, E | discussed in this section | 0.0 | |
| 13141 | Fetching from uHunt | 3.5h, Non-Classical, 2D, E | s: (level, branch_previously); t: not branching if branch_previously or branching (one side) otherwise | 0.0 | |
| nikola |
|
3.5h, Non-Classical, 2D, E | s: (pos, last_jump); t: jump forward or backward | 295 | 3.6 |
| spiderman |
|
3.5h, Non-Classical, 2D, E | simple DP; go up or down; print solution | 1010 | 3.9 |
| ticketpricing |
|
3.5h, Non-Classical, 2D, E | LA 6867 - Rocky Mountain15; similar with UVa 11450 discussed in this book; real life problem; print (the first) part of ... | 138 | 4.9 |
| 12324 | Fetching from uHunt | 3.5i, DP level 2 | spheres > n are useless | 0.0 | |
| 12862 | Fetching from uHunt | 3.5i, DP level 2 | 1D DP to compute the path cost from every vertex that goes up to the mountain top; compute answer | 0.0 | |
| 12955 | Fetching from uHunt | 3.5i, DP level 2 | there are only 8 eligible factorials under 100000; we can use DP; s: (i, sum); t: take/stay, take/move, don't take/move | 0.0 | |
| kutevi |
|
3.5i, DP level 2 | s: (360 integer degrees) | 170 | 2.6 |
| lc0714 | to replace with LeetCode link soon... | 3.5i, DP level 2 | s: (own, i); t: skip day i or sell if own/buy if not; leetcode-75 | 0 | 4.0 |
| tight |
|
3.5i, DP level 2 | s: (i, j); #tight words of length i that end in digit j divided by #words: (k+1)^n; also available at UVa 10081 - Tight ... | 100 | 3.5 |
| walrusweights |
|
3.5i, DP level 2 | backtracking with memoization | 570 | 3.8 |