# Problem List

A little collection of interesting problems that I randomly decided to do.


## Ad-hoc/Greedy
- [B. Gellyfish and Baby's Breath](https://codeforces.com/contest/2116/problem/B)

	Cool ad-hoc problem, a little of math but mostly greedy.

- [C. Ranom Numbers](https://codeforces.com/problemset/problem/1841/C)

	One of the most annoying problem I did, good to prepare for the future
	hell.

- [C. Median Splits](https://codeforces.com/problemset/problem/2103/C)

	Another incredibly annoying problem, beware...

- [D. Counting Points]](https://codeforces.com/problemset/problem/2074/D)

	I remember that I couldn't solve it before... Now it's painfully easy to do, but the
	idea might be interesting to show in a class or something.

## Data structures

- [D. Recommendations](https://codeforces.com/contest/2042/problem/D)

	Can be solved with two sets or binary search with sparse table.

- [D. Kevin and Competition Memories](https://codeforces.com/problemset/problem/2048/D)

	Another interesting sparse table problem, I'm not sure it needs one, but I solved with
	one.

- [D. R3D2 and Droid Army](https://codeforces.com/problemset/problem/514/D)

	Another sparse table problem.

- [E. Turn Off The TV](https://codeforces.com/contest/863/problem/E)

	Can be solved with sparse table or coordinate compression with prefix sum.

- [D. CGCDSSQ](https://codeforces.com/problemset/problem/475/D)

	Can be solved in two ways, but the sparse table one is interesting, although
	the other way seems more versatile.

- [A. Ntarsis' Set](https://codeforces.com/problemset/problem/1852/A)

	REALLY good binary search problem, amazing to do and think about, the binary search isn't
	obvious at all.

## Reroot

- [D. Tree XOR](https://codeforces.com/problemset/problem/1882/D)

	Interesting reroot problem, there's not much for me to say about it.

- [F. Gardening Friends](https://codeforces.com/problemset/problem/1822/F)

	Very standard reroot problem, but interesting as an exercise.

## DP

- [D. World is Mine](https://codeforces.com/problemset/problem/1987/D)

	It's cool to think about this problem, it has an interesting way to solve.

- [D. Inversion Value of a Permutation](https://codeforces.com/contest/2145/problem/D)

	Now THIS is a problem you have to think outside the box!

- [F - Prefix LIS Query](https://atcoder.jp/contests/abc393/tasks/abc393_f)

	Interesting LIS problem.

- [E - Knapsack 2](https://atcoder.jp/contests/dp/tasks/dp_e)

	Knapsack based on weight problem, classic.

- [R - Walk](https://atcoder.jp/contests/dp/tasks/dp_r)

	Classic matrix exponentiation problem.

- [Book Shop II](https://cses.fi/problemset/task/1159)

	Amazing knapsack problem, really satisfying to do!

- [E. Xor-sequences](https://codeforces.com/contest/691/problem/E)

	An interesting way to learn how to visualize a DP as a graph and optmize it
	using matrix exponentiation.

- [C. Gerrymandering](https://codeforces.com/problemset/problem/2022/C)
	
	A bit basic DP problem, but still interesting to think about all the possible
	cases and make a DP about it.

- [E. Money Buys Happiness](https://codeforces.com/problemset/problem/1974/E)

	Cool DP problem, you have to understand knapsack to do and optmize it.

- [G. Mukhammadali and the Smooth Array](https://codeforces.com/contest/2167/problem/G)

	Pretty simple, but requires optmization.

- [B. Jzzhu and Sequences](https://codeforces.com/contest/450/problem/B)

	Basic problem about matrix exponentation, but not as obvious.
	
- [D. Jellyfish and Mex](https://codeforces.com/problemset/problem/1875/D)

	An interesting problem to think about.

- [C. Lazy Narek](https://codeforces.com/problemset/problem/2005/C)

	I just liked the problem, not particularly hard.

- [D. Maximum Subarray](https://codeforces.com/problemset/problem/1796/D)

	Interesting to think about the transitions and the states, although figuring out
	it's a dp problem is already a challenge by itself.

- [C. Minimizing the Sum](https://codeforces.com/problemset/problem/1969/C)

	Simple dp problem, but it's still interesting to think about it.


## Graph

- [D. D/D/D](https://codeforces.com/problemset/problem/2109/D)

	Cool graph problem, not exactly difficult, but interesting to think about it.

- [C. Wonderful City](https://codeforces.com/problemset/problem/2096/C)

	Amazing graph/dp problem, actually interesting to think about it.

- [G2. Medium Demon Problem (hard version)](https://codeforces.com/problemset/problem/2044/G2)

	A very simple problem once you finally understand it, interesting to learn about dfs
	and all that.

- [G1. Min-Fund Prison (Easy)](https://codeforces.com/problemset/problem/1970/G1)

	A really easy problem, at least it is once you realize that it's just a tree and the
	calculation is simple.

- [E. Not Escaping](https://codeforces.com/problemset/problem/1627/E)

	AMAZING graph problem, I actually had fun solving it.

## Math

- [E2. Rudolf and Snowflakes (hard version)](https://codeforces.com/problemset/problem/1846/E2)

	Not so hard if you know how to deal with C++ or any other language with big integer, but
	it's interesting to think about regardless, can also be solved with a binary search, but
	it's not required.

- [F. Expected Median](https://codeforces.com/problemset/problem/1999/F)

	Kinda introductory combinatory problem, but interesting as an exercise.

## DSU

- [https://codeforces.com/problemset/problem/1985/H1](https://codeforces.com/problemset/problem/1985/H1)

	DSU with rollback problem, cool to think about and not really that difficult.

## Bridge

- [F. Non-academic Problem](https://codeforces.com/problemset/problem/1986/F)

	Bridge to compress the graph into a tree.

## Divide and Conquer

- [F. BattleCows](https://codeforces.com/problemset/problem/2185/F)
	
	Interesting problem to think about, good introduction to divide and conquer in my opinion and
	can be used as a bridge to segment trees.

## String

- [G1. Division + LCP (easy version)](https://codeforces.com/problemset/problem/1968/G1)

	Can be solved in a lot of ways, but I find hashing with binary search simpler.
