A list of exercises and small problems with optimal solutions for the Competitive Programming & Contests course held by Rossano Venturini at the University of Pisa.
There are 2 folders:
exercises
hands-on
The exercises are selected by the professors. Most of them come from LeetCode and other competitive programming platforms. Here's what the exercises
folder contains:
Problem | Problem Source | Solution Source | Difficulty | Topic/Paradigm |
---|---|---|---|---|
Maximum Subarray | LeetCode | max_sub_array_kadane.rs | Medium | Other |
Trapping Rain Water | LeetCode | trapping_rain_water.rs | Hard | Other |
Find Peak Element | LeetCode | search_peak_element.rs | Medium | Binary Search |
Maximum Path Sum | GeeksForGeeks | maximum_path_sum.rs | Hard | Generic Trees |
Frogs and Mosquitoes | CodeForces | frogs_and_mosquitoes.rs | N/A | Binary Search Tree |
Ranges Coverage | LeetCode | check_coverage_of_integers.rs | Easy | Sweep Line |
Longest k-Good Segments | CodeForces | longest_k_good_segment.rs | N/A | Sweep Line |
Continuous Subarray Sum | LeetCode | continuous_subarray_sum.rs | Medium | Prefix Sums |
Update the Array | Spoj | update_the_array.rs | N/A | Fenwick Tree |
Nested Segments (Fenwick Tree) | CodeForces | nested_segments_fenwick_tree.rs | N/A | Fenwick Tree |
Nested Segments (Segment Tree) | CodeForces | nested_segments_segment_tree.rs | N/A | Segment Tree |
Powerful Array | CodeForces | powerful_array.rs | N/A | Mo's Algorithm |
Longest Common Subsequence | GeeksForGeeks | longest_common_subsequence.rs | Medium | Dynamic Programming |
Minimum Number of Jumps | GeeksForGeeks | minimum_number_of_jumps.rs | Medium | Dynamic Programming |
Subset Sum Problem | GeeksForGeeks | subset_sum.rs | Medium | Dynamic Programming |
Longest Increasing Subsequence | GeeksForGeeks | longest_increasing_subsequence.rs | Medium | Dynamic Programming |
N Meetings, One Room | GeeksForGeeks | n_meetings_one_room.rs | Easy | Greedy Algorithms |
Wilbur and Array | CodeForces | wilbur_and_array.rs | N/A | Greedy Algorithms |
Woodcutters | CodeForces | woodcutter.rs | N/A | Greedy Algorithms |
Three larger-sized problems on three main topics:
Assignment | Topic |
---|---|
1 | Tree Traversal |
2 | Segment Trees with Lazy Update |
3 | Dynamic Programming |