Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simon-hrabec/Algolab-2020
Solutions for problems given in ETH course Algorithms Lab in Fall 2020
https://github.com/simon-hrabec/Algolab-2020
Last synced: 3 months ago
JSON representation
Solutions for problems given in ETH course Algorithms Lab in Fall 2020
- Host: GitHub
- URL: https://github.com/simon-hrabec/Algolab-2020
- Owner: simon-hrabec
- Created: 2020-12-23T11:06:27.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-07-31T09:47:06.000Z (over 1 year ago)
- Last Synced: 2024-02-17T07:34:10.402Z (9 months ago)
- Language: C++
- Size: 113 MB
- Stars: 54
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: change-newlines.sh
Awesome Lists containing this project
README
# Algolab 2020
Solutions for problems given in ETH course [Algorithms Lab in Fall 2020](https://www.cadmo.ethz.ch/education/lectures/HS20/algolab/index.html). I was excplicitely disallowed to share the problems descriptions. If you want to get them try emailing the responsible faculty members or Googling to find it elsewhere.The code for these problems is written with the following in mind:
- Readability. It is prevalent in competitive programming to use macros, and extremely dense and unreadable code. I dont find the price for longer names and few more lines too high. I often rewrite the problems to try something new or to see performance gain/loss therefore even I appreciate this.
- Performance. Lot of the problems could be solved with considerably less code. It would pass within the time limits. However, I tried to make the code run fast to a reasonable extent.
- Code quality. I know this is competitive programming and it does not matter much here but I found out I do better when I go a bit slower in terms of writing code and then avoid some of small bugs/issues. This is the main reason why you can see `const` everywhere and special function to load data (to have the loaded data also const).In case you find any kind of typo, bug, possible improvement, suboptimal solution, wrong explanation or anything else noteworthy do not hesitate to message me at my email `simon.hrabec` on gmail or get in touch via other means.
How to use this repository:
- Check code snippets to get an idea how to use certain libraries.
- If you get stuck and you already gave the problem some time, read the minimal amount of problem solution to get yourself unstuck.
- After finishing the task check the solutions for alternative ways to approach it
- Check the code if you just wanna compare the code of your solution and see how other people write C++.
- Compare your running time to mine to see how efficient your code is.## Featured solutions - ordered by weeks
| Week | Problem of the Week | 1st problem | 2nd problem | 3rd problem | 4th problem |
| --- | --- | --- | --- | --- | --- |
| 1 | | [Build the Sum](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2001%20-%20Build%20the%20Sum) | [Dominoes](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2001%20-%20Dominoes) | [Even Matrices](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2001%20-%20Even%20Matrices) | [Even Pairs](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2001%20-%20Even%20Pairs) |
| 2 | [Deck of Cards](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2002%20PotW%20-%20Deck%20of%20Cards) | [Beach Bars](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2002%20-%20Beach%20Bars) | [Burning Coins](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2002%20-%20Burning%20Coins) | [Search Snippets](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2002%20-%20Search%20Snippets) | [The Great Game](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2002%20-%20The%20Great%20Game) |
| 3 | [From Russia with Love](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2003%20PotW%20-%20From%20Russia%20with%20Love) | [Antenna](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2003%20-%20Antenna) | [First Hit](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2003%20-%20First%20Hit) | [Hiking Maps](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2003%20-%20Hiking%20Maps) | [Hit](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2003%20-%20Hit) |
| 4 | [Defensive Line](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2004%20PotW%20-%20Defensive%20Line) | [Ant Challenge](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2004%20-%20Ant%20Challenge) | [Buddy Selection](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2004%20-%20Buddy%20Selection) | [First steps with BGL](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2004%20-%20First%20steps%20with%20BGL) | [Important Bridges](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2004%20-%20Important%20Bridges) |
| 5 | [Motorcycles](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2005%20PotW%20-%20Motorcycles) | [Asterix the Gaul](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2005%20-%20Asterix%20the%20Gaul) | [Attack of the Clones](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2005%20-%20Attack%20of%20the%20Clones) | [Boats](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2005%20-%20Boats) | [San Francisco](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2005%20-%20San%20Francisco) |
| 6 | [Tracking](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2006%20PotW%20-%20Tracking) | [Kingdom Defence](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2006%20-%20Kingdom%20Defence) | [Knights](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2006%20-%20Knights) | [Shopping Trip](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2006%20-%20Shopping%20Trip) | [Tiles](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2006%20-%20Tiles) |
| 7 | [Octopussy](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2007%20PotW%20-%20Octopussy) | [Diet](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2007%20-%20Diet) | [Inball](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2007%20-%20Inball) | [Radiation](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2007%20-%20Radiation) | [What is the Maximum](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2007%20-%20What%20is%20the%20Maximum) |
| 8 | [Surveillance Photograph](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2008%20PotW%20-%20Surveillance%20Photograph) | [Bistro](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2008%20-%20Bistro) | [Clues](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2008%20-%20Clues) | [Germs](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2008%20-%20Germs) | [H1N1](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2008%20-%20H1N1) |
| 9 | [Legions](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2009%20PotW%20-%20Legions) | [Algocoon Group](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2009%20-%20Algocoon%20Group) | [Casino Royale](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2009%20-%20Casino%20Royale) | [Placing Knights](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2009%20-%20Placing%20Knights) | [Real Estate Market](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2009%20-%20Real%20Estate%20Market) |
| 10 | [Idefix](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2010%20PotW%20-%20Idefix) | [Asterix and the Chariot Race](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2010%20-%20Asterix%20and%20the%20Chariot%20Race) | [Asterix in Switzerland](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2010%20-%20Asterix%20in%20Switzerland) | [New York](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2010%20-%20New%20York) | [Worldcup](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2010%20-%20Worldcup) |
| 11 | [Fleetrace](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2011%20PotW%20-%20Fleetrace) | [Fighting Pits of Meereen](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2011%20-%20Fighting%20Pits%20of%20Meereen) | [Hand](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2011%20-%20Hand) | [Lestrade](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2011%20-%20Lestrade) | [Return of the Jedi](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2011%20-%20Return%20of%20the%20Jedi) |
| 12 | [The Iron Islands](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2012%20PotW%20-%20The%20Iron%20Islands) | [Car Sharing](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2012%20-%20Car%20Sharing) | [Hong Kong](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2012%20-%20Hong%20Kong) | [India](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2012%20-%20India) | [Moving Books](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2012%20-%20Moving%20Books) |
| 13 | [On Her Majestys Secret Service](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20PotW%20-%20On%20Her%20Majestys%20Secret%20Service) | [Evolution](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20-%20Evolution) | [Marathon](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20-%20Marathon) | [Punch](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20-%20Punch) | [Sith](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20-%20Sith) |## Featured solutions - ordered by technique/algorithm/data structure
- BFS - [W08/Clues](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2008%20-%20Clues) [W13/Sith](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20-%20Sith)
- Biconnected Components - [W04/Important Bridges](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2004%20-%20Important%20Bridges)
- Binary Search - [W05/Asterix the Gaul](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2005%20-%20Asterix%20the%20Gaul) [W10/Worldcup](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2010%20-%20Worldcup) [W12/India](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2012%20-%20India) [W12/Moving Books](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2012%20-%20Moving%20Books) [W13/Evolution](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20-%20Evolution) [W13/Marathon](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20-%20Marathon) [W13/Sith](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20-%20Sith) [W13/On Her Majestys Secret Service](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20PotW%20-%20On%20Her%20Majestys%20Secret%20Service)
- Bit Manipulation - [W10/Worldcup](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2010%20-%20Worldcup) [W11/Fighting Pits of Meereen](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2011%20-%20Fighting%20Pits%20of%20Meereen)
- CGAL Geometry - [W03/Antenna](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2003%20-%20Antenna) [W03/First Hit](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2003%20-%20First%20Hit) [W03/Hiking Maps](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2003%20-%20Hiking%20Maps) [W03/Hit](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2003%20-%20Hit)
- CGAL::Gmpq/Gmpz (Arbitrary Precision Types) - [W05/Motorcycles](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2005%20PotW%20-%20Motorcycles) [W07/Radiation](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2007%20-%20Radiation)
- DFS - [W05/Asterix the Gaul](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2005%20-%20Asterix%20the%20Gaul) [W10/Asterix and the Chariot Race](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2010%20-%20Asterix%20and%20the%20Chariot%20Race) [W10/New York](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2010%20-%20New%20York) [W11/Return of the Jedi](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2011%20-%20Return%20of%20the%20Jedi) [W13/Evolution](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20-%20Evolution) [W13/Sith](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20-%20Sith)
- Delaunay Triangulation - [W08/Bistro](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2008%20-%20Bistro) [W08/Clues](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2008%20-%20Clues) [W08/Germs](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2008%20-%20Germs) [W0811/H1N1](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2008%20-%20H1N1) [W10/Worldcup](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2010%20-%20Worldcup) [W10/Idefix](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2010%20PotW%20-%20Idefix) [W11/Hand](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2011%20-%20Hand) [W11/Lestrade](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2011%20-%20Lestrade) [W12/Hong Kong](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2012%20-%20Hong%20Kong) [W13/Sith](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20-%20Sith)
- Dijkstra - [W04/Ant Challenge](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2004%20-%20Ant%20Challenge) [W04/First steps with BGL](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2004%20-%20First%20steps%20with%20BGL) [W06/Tracking](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2006%20PotW%20-%20Tracking) [W0811/H1N1](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2008%20-%20H1N1) [W12/Hong Kong](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2012%20-%20Hong%20Kong) [W13/Marathon](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20-%20Marathon) [W13/On Her Majestys Secret Service](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20PotW%20-%20On%20Her%20Majestys%20Secret%20Service)
- Dynamic Programming - [W02/Burning Coins](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2002%20-%20Burning%20Coins) [W02/The Great Game](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2002%20-%20The%20Great%20Game) [W03/From Russia with Love](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2003%20PotW%20-%20From%20Russia%20with%20Love) [W04/Defensive Line](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2004%20PotW%20-%20Defensive%20Line) [W05/San Francisco](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2005%20-%20San%20Francisco) [W12/The Iron Islands](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2012%20PotW%20-%20The%20Iron%20Islands) [W13/Punch](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20-%20Punch)
- Graph Duplication - [W06/Knights](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2006%20-%20Knights) [W06/Tracking](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2006%20PotW%20-%20Tracking) [W08/Surveillance Photograph](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2008%20PotW%20-%20Surveillance%20Photograph) [W09/Placing Knights](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2009%20-%20Placing%20Knights)
- Greedy - [W05/Attack of the Clones](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2005%20-%20Attack%20of%20the%20Clones) [W05/Boats](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2005%20-%20Boats) [W07/Octopussy](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2007%20PotW%20-%20Octopussy)
- Linear Programming - [W07/Diet](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2007%20-%20Diet) [W07/Inball](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2007%20-%20Inball) [W07/Radiation](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2007%20-%20Radiation) [W07/What is the Maximum](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2007%20-%20What%20is%20the%20Maximum) [W09/Legions](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2009%20PotW%20-%20Legions) [W10/Worldcup](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2010%20-%20Worldcup) [W11/Lestrade](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2011%20-%20Lestrade)
- Max-Flow-Min-Cost - [W09/Casino Royale](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2009%20-%20Casino%20Royale) [W09/Real Estate Market](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2009%20-%20Real%20Estate%20Market) [W11/Fleetrace](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2011%20PotW%20-%20Fleetrace) [W12/Car Sharing](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2012%20-%20Car%20Sharing) [W12/India](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2012%20-%20India) [W13/Marathon](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20-%20Marathon)
- Maximum Flow - [W06/Kingdom Defence](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2006%20-%20Kingdom%20Defence) [W06/Knights](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2006%20-%20Knights) [W06/Shopping Trip](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2006%20-%20Shopping%20Trip) [W06/Tiles](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2006%20-%20Tiles) [W08/Surveillance Photograph](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2008%20PotW%20-%20Surveillance%20Photograph) [W09/Algocoon Group](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2009%20-%20Algocoon%20Group) [W09/Placing Knights](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2009%20-%20Placing%20Knights) [W10/Asterix in Switzerland](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2010%20-%20Asterix%20in%20Switzerland)
- Maximum Matching - [W04/Buddy Selection](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2004%20-%20Buddy%20Selection) [W06/Tiles](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2006%20-%20Tiles) [W13/On Her Majestys Secret Service](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2013%20PotW%20-%20On%20Her%20Majestys%20Secret%20Service)
- Minimum Spanning Tree - [W04/Ant Challenge](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2004%20-%20Ant%20Challenge) [W04/First steps with BGL](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2004%20-%20First%20steps%20with%20BGL) [W11/Return of the Jedi](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2011%20-%20Return%20of%20the%20Jedi)
- Prefix Sum - [W01/Even Matrices](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2001%20-%20Even%20Matrices) [W01/Even Pairs](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2001%20-%20Even%20Pairs)
- Randomization - [W03/Antenna](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2003%20-%20Antenna) [W03/First Hit](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2003%20-%20First%20Hit)
- Split and List - [W05/Asterix the Gaul](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2005%20-%20Asterix%20the%20Gaul)
- Two Pointers - [W02/Beach Bars](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2002%20-%20Beach%20Bars) [W02/Search Snippets](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2002%20-%20Search%20Snippets) [W02/Deck of Cards](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2002%20PotW%20-%20Deck%20of%20Cards) [W04/Defensive Line](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2004%20PotW%20-%20Defensive%20Line)
- Union-Find - [W10/Idefix](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2010%20PotW%20-%20Idefix) [W11/Hand](https://github.com/simon-hrabec/Algolab2020/tree/main/problems/Week%2011%20-%20Hand)
## Code snippets
One of the most annoying thing about ALGOLAB (after the hard thinking ^^) is to always copy paste the right definitions for boost graphs, CGAL LP or flow edge adder. For this reason I put together a small set of useful snippets that should cover all your basic needs. It shoud prevent you from always searching the lecture notes or code examples for the relevant lines or going to the CGAL docs for basic syntax. You should find it here at one place. Some of the snippets are in fact the code from lectures or code examples (modified to some extent), some are written from scratch. The all attributions are listed in the code snippet descriptions.
- [Main function - N cases](https://github.com/simon-hrabec/Algolab2020/tree/main/code-snippets#Main-function---N-cases)
- [Main function - 0 terminated](https://github.com/simon-hrabec/Algolab2020/tree/main/code-snippets#Main-function---0-terminated)
- [Kernel conversions](https://github.com/simon-hrabec/Algolab2020/tree/main/code-snippets#Kernel-conversions)
- [CGAL round down](https://github.com/simon-hrabec/Algolab2020/tree/main/code-snippets#CGAL-round-down)
- [CGAL round up](https://github.com/simon-hrabec/Algolab2020/tree/main/code-snippets#CGAL-round-up)
- [CGAL intersections](https://github.com/simon-hrabec/Algolab2020/tree/main/code-snippets#CGAL-intersections)
- [Min Circle](https://github.com/simon-hrabec/Algolab2020/tree/main/code-snippets#Min-Circle)
- [Linear programming](https://github.com/simon-hrabec/Algolab2020/tree/main/code-snippets#Linear-programming)
- [Range loop - iterator wrapper](https://github.com/simon-hrabec/Algolab2020/tree/main/code-snippets#Range-loop---iterator-wrapper)