1. TODO

    Top Current: ELF Immediate: Writing an ELF manually Stack For I have so little time.

  2. Ingenuity

    This is a list of problems with deceptively simple solutions, all that I might’ve either completely missed or arrived at via a contrived way losing the essence and intuition of it.

  3. To Reason

    I’m really disheartened today.

  4. Bitmask DP

    Bitmask DP Considerations? Do I iterate over set bits and remove them? Is optimal structure a vine Do I iterate over submasks and remove them? Is optimal structure a tree Think bitmask dp, when iterating over permutations of processing order would works.

  5. Digit DP

    Digit DP Typical state: position, tight bound, leading-zero state, and the problem-specific state.

  6. Knapsack

    Knapsack Fractional knapsack greedy, sort items by value/wt and pick max ones 0/1 Knapsack - O(nw) time and O(nw) space variant def: f(w) ⇒ max value s.t.

  7. DP

    Dynamic Programming Dice Combinations way to make sum n by using a(i) repeatedly → what is f? defn: f(i) = no of throws to make i base: f(⇐0) = 1 trans: f(i) = sum over throw in 1..6 : f(i-throw) Min Coins min number of a(i) needed ( rep ) to make sum n Problem is framed as coins def: min no of coin...

  8. CSES Graph Problems

    CSES Graph Problems Graphs Aim here is to implement whatever multiple approaches and use this as reference for programming style for future.

  9. Trees

    Trees Company Queries // problem: go up k levels // tag: bin lift #include <bits/stdc++.h> using namespace std; int main() { #define int long long int n, q; cin >> n >> q; vector<vector<int>> g(n + 1); for (int i = 2; i <= n; i++) { int u; cin >> u; g[u].push_b...