https://blog.monashicpc.com/new_binder//new_binder/Monash Code BinderA collection of algorithms, explanations and training problems 2021-10-03T13:24:04+11:00 Monash Programming Team https://blog.monashicpc.com/new_binder//new_binder/ Jekyll © 2021 Monash Programming Team /new_binder/assets/img/favicons/favicon.ico /new_binder/assets/img/favicons/favicon-96x96.png Challenge Problems - 2021 Sem 2, Contest 12021-08-23T11:00:00+10:00 2021-08-23T11:00:00+10:00 https://blog.monashicpc.com/new_binder//new_binder/posts/problems-21-s2-c1/ Monash Programming Team Sports Loans Statement Andrew is head of the sports club, and manages the inventory. Part of Andrew’s job is loaning footballs to people, and collecting those footballs once they have been used. At the start of the day, Andrew has \(r\) footballs in stock, and knows that \(p+q\) people will approach him over the course of the day. \(p\) people will request a football, while \(q\) people will... Least Common Ancestor (LCA)2021-04-20T22:00:00+10:00 2021-05-05T16:12:40+10:00 https://blog.monashicpc.com/new_binder//new_binder/posts/lca/ Monash Programming Team Where is this useful? The Least Common Ancestor (LCA) data structure is useful wherever you have a directed graph where every vertex has out-degree \(\leq 1\). In more common terms, each vertex has a unique determined ‘parent’, or it is a root node, with no parent. The most common (and almost always only) example being a rooted tree. On these particular graphs, the LCA gives us a fast way to ... Primes and Factorization Techniques2021-04-05T11:00:00+10:00 2021-04-05T21:02:26+10:00 https://blog.monashicpc.com/new_binder//new_binder/posts/factorization/ Monash Programming Team Why? Many number theoretic problems in competitive programming require analysing the factors or prime factors of a number. Here I’ll list a few techniques for finding these factors, and some techniques / properties involving the factors / prime factors of a number. Preliminaries First off, lets define our basic terms, then we can get into the interesting stuff. Definitions For a positive i... Modular Arithmetic2021-03-29T18:40:00+11:00 2021-04-01T22:07:32+11:00 https://blog.monashicpc.com/new_binder//new_binder/posts/mod/ Monash Programming Team What is it? Modular Arithmetic encompasses all sorts of theorems and optimizations surrounding the % operator in C and Python. As you’ll see in the related problems, modulo arithmetic is often tied together in a question regarding counting things (combinatorics) or probabilities. For those who haven’t come up across it before, % is an operation normally performed on two integers \(a\) and \(... Dynamic Programming2021-03-26T10:32:00+11:00 2021-03-29T18:33:53+11:00 https://blog.monashicpc.com/new_binder//new_binder/posts/dp/ Monash Programming Team Why? Dynamic Programming (DP) is one of the most powerful tools you’ll come across in competitive programming. It normally turns up in about a third of all problems in a contest, in some form or another. What is it? Dynamic Programming is a general tactic centred around storing previous calculations so that you don’t need to recompute the outcome of certain functions. While this might seem l...