YouKn0wWho Academy — The Ultimate Topic List (Full Topic Map)¶
Source / attribution: The Ultimate Topic List by YouKn0wWho (Shahjalal Shohag). Structure extracted from the author's official open-source export ShahjalalShohag/the-ultimate-topic-list (MIT License, data exported from the same database as the live site; static mirror: the-ultimate-topic-list.vercel.app). Templates come from ShahjalalShohag/code-library.
This file contains roadmap structure and official links only — topic names, IDs, difficulty/importance ratings, prerequisites, resource links, template links, and problem links. No explanations, editorials, or problem statements are reproduced. Use the topic page links for the actual content.
Generated: 2026-06-05 · Data export: 2025-09-28 · Live site currently reports 576 topics; this export contains 570 (delta: Number Theory +2, Combinatorics +1, Math +1, Miscellaneous +2 on the live site). Re-sync from the live site for the newest additions.
How to read this map¶
- Hierarchy: Category → Subcategory → Topic. The order is the author's recommended learning order — earlier items are the implied prerequisites of later ones. Explicit
Prerequisitesare listed only where the author defined them. - Topic page: every topic links to
https://youkn0wwho.academy/topic-list/<topic_id>(resources, starred picks, and the problem list live there). - Difficulty: Very Easy · Easy · Medium · Hard · Very Hard (author's rating).
- Importance: ★★★ must-know · ★★☆ good-to-know · ★☆☆ rare/optional.
- Phase: the author's learning-path phase number (lower = earlier), where defined.
- ★ on a resource/problem: starred (recommended) by the author.
- Problem difficulty tag
[VE/E/M/H/VH]: author's per-problem rating where it parses to the 0–4 scale,[—]otherwise.
Contents¶
- Basics — 19 subcategories, 56 topics
- Data Structures (DS) — 18 subcategories, 82 topics
- Graph Theory — 21 subcategories, 103 topics
- Number Theory — 9 subcategories, 57 topics
- Combinatorics — 7 subcategories, 24 topics
- Math — 10 subcategories, 79 topics
- Strings — 7 subcategories, 31 topics
- Dynamic Programming (DP) — 10 subcategories, 35 topics
- Game Theory — 4 subcategories, 7 topics
- Geometry — 10 subcategories, 55 topics
- Miscellaneous — 11 subcategories, 41 topics
1. Basics¶
Category ID: basics · Subcategories: 19 · Topics: 56
1.1 Intro to Programming¶
Subcategory ID: intro_to_programming · Topics: 1
1.1.1 What is Programming?¶
- ID:
programming· Difficulty: Very Easy · Importance: ★★★ · Phase: 0 - Topic page: https://youkn0wwho.academy/topic-list/programming
- Resources (4):
- ★ Why Programming Is Important? | Bugra Kilic
- ★ What is Coding? | TeXplaiNIT
- What is Programming? | Code Academy
- ★ What is Computer Programming? | freecodecamp
1.2 Learn a Language¶
Subcategory ID: learning_a_language · Topics: 10
1.2.1 Intro to C++ and Setting up the Environment¶
- ID:
intro_to_cpp· Difficulty: Very Easy · Importance: ★★★ · Phase: 0 - Topic page: https://youkn0wwho.academy/topic-list/intro_to_cpp
- Resources (10):
- C++ Introduction | W3 Schools
- CodeBlocks IDE Installation on Windows 10/11 [2023 Update] MinGW GCC Compiler | C & C++ Programming Geeky Script
- How to install CodeBlocks on Mac #1 CProgramming | CSBHASHA
- Install and setup CodeBlocks C/C++ IDE on Linux | LinuxH2O
- How to Compile and Run C++ Code | Tech With Tim
- ★ Getting Started With C++ | Programiz
- Your First C++ Program | Programiz
- ★ Online IDE
- ★ C++ Tutorial for Beginners - Full Course | freeCodeCamp.org
- ★ Virtual Judge
- Problems (1):
[E]★ Hello World
1.2.2 Data Types, Variables and Input Output¶
- ID:
variables_and_data_types· Difficulty: Very Easy · Importance: ★★★ · Phase: 0 - Topic page: https://youkn0wwho.academy/topic-list/variables_and_data_types
- Resources (9):
- ★ C++ Program Structure | Tech With Tim
- ★ Data Types and Variables | Tech With Tim
- ★ User Input and Constants | Tech With Tim
- C++ Variables, Literals and Constants | Programiz
- C++ Comments | Programiz
- C++ Data Types | Programiz
- C++ Constants | Programiz
- C++ Basic Input/Output | Programiz
- ★ Data Types | USACO Guide
- Problems (1):
[E]★ Basic Data Types
1.2.3 Operators¶
- ID:
operators· Difficulty: Very Easy · Importance: ★★★ · Phase: 0 - Topic page: https://youkn0wwho.academy/topic-list/operators
- Resources (5):
- ★ Arithmetic Operators | Tech With Tim
- ★ Comparison Operators | Tech With Tim
- ★ Logical Operators (And, Or and Not) | Tech With Tim
- ★ C++ Operators | Programiz
- ★ C++ Relational and Logical Operators | Programiz
- Problems (6):
[E]★ Simple Calculator[E]★ Difference[E]★ Area of a Circle[E]★ Age in Days[M]★ Summation from 1 to N[M]★ The last 2 digits
1.2.4 Conditional Statements¶
- ID:
conditional_statements· Difficulty: Very Easy · Importance: ★★★ · Phase: 0 - Topic page: https://youkn0wwho.academy/topic-list/conditional_statements
- Resources (2):
- ★ If, Else & Else If | Tech With Tim
- ★ C++ if, if...else and Nested if...else | Programiz
- Problems (11):
[E]★ Welcome for you with Conditions[E]★ Multiples[E]★ Capital or Small or Digit[E]Char[E]Interval[E]Float or int[E]Comparison[M]★ Max and Min[M]★ Sort Numbers[M]★ Mathematical Expression[H]★ Coordinates of a Point
1.2.5 Loops¶
- ID:
loops· Difficulty: Very Easy · Importance: ★★★ · Phase: 0 - Topic page: https://youkn0wwho.academy/topic-list/loops
- Resources (6):
- ★ For Loops | Tech With Tim
- C++ for Loop | Programiz
- ★ While, Do While Loops & Break/Continue | Tech With Tim
- C++ while and do...while Loop | Programiz
- ★ C++ break Statement | Programiz
- ★ C++ continue Statement | Programiz
- Problems (18):
[E]★ 1 to N[E]★ Even Numbers[E]★ Even, Odd, Positive and Negative[E]Fixed Password[E]★ Multiplication table[E]★ Factorial[E]★ One Prime[E]★ Divisors[E]Numbers Histogram[E]★ Pyramid[E]★ Shape1[E]Max[M]★ Digits[M]Sequence of Numbers and Sum[M]★ Sum of Consecutive Odd Numbers[M]★ Shape2[H]★ Shape3[H]Convert To Decimal 2
1.2.6 Functions¶
- ID:
functions· Difficulty: Very Easy · Importance: ★★★ · Phase: 0 - Topic page: https://youkn0wwho.academy/topic-list/functions
- Resources (6):
- ★ Functions | Tech With Tim
- ★ C++ Functions | Programiz
- ★ C++ User-defined Function Types | Programiz
- C++ Programming Default Arguments (Parameters) | Programiz
- C++ Function Overloading | Programiz
- ★ Top 10 Most Used Inbuilt C++ functions for Competitive Programming | Geeks for Geeks
- Problems (10):
[E]Add[E]★ Two numbers[E]★ Swap[E]★ GCD[E]★ Wonderful Number[E]★ Primes from 1 to n[M]★ Lucky Numbers[M]★ Some Sums[M]Equation[H]★ Hard Compare
1.2.7 Arrays¶
- ID:
arrays· Difficulty: Very Easy · Importance: ★★★ · Phase: 0 - Topic page: https://youkn0wwho.academy/topic-list/arrays
- Resources (4):
- ★ Arrays | Tech With Tim
- ★ C++ Arrays | Programiz
- Passing Array to a Function in C++ Programming | Programiz
- C++ Multidimensional Arrays | Programiz
- Problems (21):
[E]★ Summation[E]★ Searching[E]Replacement[E]Max[E]★ Lowest Number[E]★ Easy Fibonacci[M]★ Reversing[M]★ Palindrome Array[M]★ Sorting[M]★ Smallest Pair[M]★ Max Subarray[M]★ Replace MinMax[M]★ Minimize Number[M]Count Subarrays[M]★ Permutation with arrays[H]★ Frequency Array[H]★ Is B a subsequence of A ?[H]★ Search In Matrix[H]★ Matrix[H]Mirror Array[H]★ 2D Array - DS
1.2.8 Strings¶
- ID:
strings· Difficulty: Very Easy · Importance: ★★★ · Phase: 0 - Topic page: https://youkn0wwho.academy/topic-list/strings
- Resources (3):
- Strings | Tech With Tim
- C++ Strings | Programiz
- C++ String Class | Programiz
- Problems (16):
[E]★ Say Hello With C++[E]Create A New String[E]★ Let's use Getline[E]★ Way Too Long Words[E]First digit ![E]★ Sum Digits[E]Conversion[M]The Brothers[M]Calculator[M]★ Compare[M]★ Strings[M]★ Good or Bad[M]★ Palindrome[M]★ Count Letters[M]I Love strings[H]★ 8 Neighbors
1.2.9 Pointers and References¶
- ID:
pointers· Difficulty: Very Easy · Importance: ★★★ · Phase: 0 - Topic page: https://youkn0wwho.academy/topic-list/pointers
- Resources (7):
- ★ Pointers (*) | Tech With Tim
- ★ References (&) | Tech With Tim
- ★ Pointers in C/C++
- C++ Pointers | Programiz
- C++ Pointers and Arrays | Programiz
- C++ References | Programiz
- ★ C++ Pass by Reference | Programiz
- Problems (1):
[E]★ Pointer
1.2.10 Structures¶
- ID:
structures· Difficulty: Very Easy · Importance: ★★★ · Phase: 0 - Topic page: https://youkn0wwho.academy/topic-list/structures
- Resources (3):
- ★ C++ Structures | Programiz
- C++ Structure and Function | Programiz
- Structure In C++ | CppNuts
1.3 Intro to Competitive Programming¶
Subcategory ID: intro_to_cp · Topics: 1
1.3.1 What is Competitive Programming?¶
- ID:
competitive_programming· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/competitive_programming
- Resources (11):
- ★ Competitive-Programming-A-Complete-Guideline | YouKn0wWho
- ★ What is Competitive Programming? | William Lin
- ★ How to start Competitive Programming? For beginners! | Errichto Algorithms
- ★ How to Practice | USACO Guide
- ★ Contest Strategy | USACO Guide
- ★ Resources: Competitive Programming | USACO Guide
- ★ Contests | USACO Guide
- ★ How to Debug | USACO Guide
- ★ Basic Debugging | USACO Guide
- My Video Tutorials for all the practice problems below [in Bangla]
- ★ Editorial, Codes and AI Help for all the practice problems below
- Problems (18):
[E]★ Multiplication 1[E]★ Again Twenty Five![E]★ Counting[E]Buttons[E]Round decimals[E]★ Four Digits[E]Biscuit Generator[E]Find Multiple[E]★ Ebony and Ivory[E]Square Inequality[E]Discount[E]AC or WA[E]★ Tricky Sum[E]★ Almost Prime[M]★ How many?[M]★ Beautiful Year[M]★ Sum of Three Integers[H]★ Sum of Digits
1.4 Bitwise Thinking¶
Subcategory ID: bitwise_thinking · Topics: 1
1.4.1 Bitwise Operations and Bitmasks¶
- ID:
bitwise_operations· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/bitwise_operations
- Templates (2):
- Bitwise Operations.cpp
- Bitmasks.cpp
- Resources (3):
- ★ C++ Bitwise Operators | Programiz
- ★ Bitwise operations for beginners By Errichto
- Learn these 10 Bitwise Tricks Or Regret Later | Competitive Programming Tricks Part 2
- Problems (18):
[E]★ Bitwise Operators[E]★ Maximizing XOR[E]Day 29: Bitwise AND[E]★ Check bit[E]★ Flipping bits[E]★ Swap Bits[E]★ Reverse Bits[E]Raising Bacteria[E]★ Bit Strings[M]★ Petr and a Combination Lock[M]★ Preparing Olympiad[M]Bars[M]Little Elephant and Bits[M]★ Lucky Numbers (easy)[M]Many Formulas[M]★ Apple Division[M]★ Factorials and Powers of Two[H]★ Knapsack
1.5 Complexity Analysis¶
Subcategory ID: complexity_analysis · Topics: 2
1.5.1 Big O Notation and Time and Space Complexity Analysis¶
- ID:
complexity_analysis· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/complexity_analysis
- Resources (9):
- ★ Mastering Big O Notation: Understanding Time and Space Complexity in Algorithms | Chinenye Okeke
- ★ Introduction to Big-O WilliamFiset
- Big O Notation & Time Complexity Analysis Tutorial | Tech With Tim
- Big-O Notation - For Coding Interviews | NeetCode
- ★ Time Complexity | USACO Guide
- Complete Guide On Complexity Analysis – Data Structure and Algorithms Tutorial | Geeks for Geeks
- A Time Complexity Guide By UnexpectedValue
- ★ How to determine the solution of a problem by looking at its constraints? By eanacra
- Introduction to Big O Notation and Time Complexity | CS Dojo
- Problems (6):
[E]★ Again Twenty Five![E]★ Tricky Sum[E]★ Divisibility Problem[E]★ Calculating Function[M]★ Sum of Three Integers[M]Repetitions
1.5.2 Fast Input Output¶
- ID:
fast_input_output· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/fast_input_output
- Resources (3):
- ★ Fast Input/Output | G&G
- Fast input output
- ★ Fast Input & Output | USACO Guide
- Problems (1):
[E]★ Enormous Input and Output Test
1.6 Recursion¶
Subcategory ID: recursion · Topics: 1
1.6.1 Recursion¶
- ID:
recursion· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/recursion
- Resources (7):
- ★ Recursion in C | Neso Academy
- ★ C++ Recursion
- ★ 5 Simple Steps for Solving Any Recursive Problem | Reducible
- ★ Towers of Hanoi: A Complete Recursive Visualization | Reducible
- Introduction to Recursion – Data Structure and Algorithm Tutorials | Geeks for Geeks
- [Bangla] An In-depth Analysis of Function and Recursion in Competitive Programming - YouKn0wWho Academy
- Recursion Series | take U forward
- Problems (14):
[E]★ Print Recursion[E]★ Print from 1 to N[E]Print from N to 1[E]★ Factorial[E]★ Fibonacci[E]Print Even Indices[E]★ Hello Recursion[E]★ Weird Algorithm[E]Palindrome Array[E]★ Tower of Hanoi[M]★ Number of Ways[M]★ Apple Division[H]★ Reach Value[H]★ Knapsack
1.7 Very Basic Math¶
Subcategory ID: very_basic_math · Topics: 3
1.7.1 Divisors¶
- ID:
divisors· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/divisors
- Templates (1):
- Divisors.cpp
- Resources (3):
- ★ C++ Program to Display Factors of a Number | Programiz
- ★ L2. Print all Divisors of a Number | Maths Playlist | take U forward
- Find all divisors of a natural number - Set 2 in C++ | tutorialspoint
- Problems (5):
[E]★ Divisors[E]How Many Divisors?[E]★ k-th divisor[E]★ Counting Divisors[M]★ Product of Three Numbers
1.7.2 GCD and LCM¶
- ID:
gcd_and_lcm· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/gcd_and_lcm
- Templates (1):
- GCD and LCM.cpp
- Resources (3):
- ★ GCD of Two Numbers in C++ | Geeks for Geeks
- ★ C++ Program to Find LCM | Programiz
- Properties Of GCD function
- Problems (13):
[E]★ Greatest Common Divisor[E]★ LCM and HCF[E]★ Common Divisors[E]Dora and C++[E]Two Divisors[M]LCM Problem[M]GCDs[M]Bestie[M]Exciting Bets[H]★ Minimum LCM[H]★ Fadi and LCM[H]★ Diluc and Kaeya[H]Annoying String Problem
1.7.3 Harmonic Number¶
- ID:
harmonic_series· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/harmonic_series
- Templates (1):
- Harmonic Number Example.cpp
- Resources (4):
- Harmonic number | Wiki
- Proof: harmonic series diverges | Series | AP Calculus BC | Khan Academy
- ★ what is the complexity of harmonic series
- [Slightly Hard] Investigating harmonic numbers By Proofy
- Problems (10):
[E]★ Counting Divisors[E]★ Divisor Summation[E]★ We Were Both Children[E]Number of common divisors[E]★ Aliquot Sum[E]Removing Smallest Multiples[E]Make Them Equal[M]Orac and Models[M]Super Hero[H]Kevin and Competition Memories
1.8 Range Queries Without Updates¶
Subcategory ID: range_queries_without_updates · Topics: 2
1.8.1 Prefix Sum¶
- ID:
prefix_sum· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/prefix_sum
- Templates (1):
- Prefix Sum.cpp
- Resources (2):
- ★ Prefix Sums - Problems | Errichto Algorithms
- ★ Introduction to Prefix Sums | USACO Guide
- Problems (27):
[E]★ Static Range Sum Queries[E]Static Range Sum[E]count a's[E]★ Odd Queries[E]★ Breed Counting[E]★ Kuriyama Mirai's Stones[E]Little Chef and Sums[E]Worms[E]Black and White Stripe[E]Scuza[E]Vlad and a Sum of Sum of Digits[E]Binary Deque[E]Maximum Sum[E]Closest Cities[M]Fence[M]★ Subsequences Summing to Sevens[M]Prefix Sum Addicts[M]★ Subarray Sums II[M]★ Subarray Divisibility[M]Volcanic Eruption[M]Left and Right Houses[M]Playing in a Casino[M]A and B[H]Maximum Subarray Sum[H]★ Romantic Glasses[VH]Sums of Segments[VH]Sum of Subarrays
1.8.2 Prefix XOR¶
- ID:
prefix_xor· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/prefix_xor
- Templates (1):
- Prefix Xor.cpp
- Resources (2):
- Prefix Xor Array | Geeks for Geeks
- ★ CSES - Range Xor Queries | USACO Guide
- Problems (1):
[E]★ Range Xor Queries
1.9 Standard Template Library (STL)¶
Subcategory ID: stl · Topics: 11
1.9.1 Intro to STL, Containers and Iterators¶
- ID:
stl_intro· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/stl_intro
- Resources (7):
- ★ C++ Standard Template Library | Programiz
- ★ Introduction | C++ STL (Standard Template Library) | Knowledge Center
- ★ Containers C++ | C++ STL (Standard Template Library) Knowledge Center
- ★ Iterators in C++ | C++ STL (Standard Template Library) | types of Iterators Knowledge Center
- ★ Iterators Functions | C++ STL (Standard Template Library) | 4 important iterator functions Knowledge Center
- Iterator Invalidation | C++ STL (Standard Template Library) Knowledge Center
- ★ C++ Iterators | Programiz
1.9.2 Pairs and Tuples¶
- ID:
pairs_and_tuples· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/pairs_and_tuples
- Resources (3):
- ★ Pair in C++ Standard Template Library (STL) | Geeks for Geeks
- ★ Tuples | Tech With Tim
- ★ Tuples in C++ | Geeks for Geeks
- Problems (2):
[E]★ Indian Summer[E]★ A1. Balanced Shuffle (Easy)
1.9.3 Vector¶
- ID:
vector· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/vector
- Resources (7):
- ★ Vectors | Tech With Tim
- ★ C++ Vectors | Programiz
- Vector | C++ STL (Standard Template Library) | std::vector Knowledge Center
- Complete C++ STL in 1 Video | Time Complexity and Notes | take U forward
- Vector in C++ STL | TUF
- Vector in C++ STL | Geeks for Geeks
- [Hindi] Vector In C++ STL | CodeWithHarry
- Problems (7):
[E]★ Vector[E]★ Vector-Sort[E]★ Vector-Erase[E]★ Vector II[E]Good Sequence[M]★ Lower Bound-STL[M]Thor
1.9.4 Stack¶
- ID:
stack· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/stack
- Resources (4):
- ★ C++ Stack | Programiz
- Stack | C++ STL (Standard Template Library) | std::stack Knowledge Center
- Complete C++ STL in 1 Video | Time Complexity and Notes | take U forward
- Stack in C++ STL | Geeks for Geeks
- Problems (7):
[E]★ Simple Stack[E]★ Valid Parentheses[E]★ Stacks: Balanced Brackets[E]★ Nearest Smaller Values[E]Even Positions[M]★ Longest Regular Bracket Sequence[M]Scope
1.9.5 Queue¶
- ID:
queue· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/queue
- Resources (4):
- ★ C++ Queue | Programiz
- Queue | C++ STL (Standard Template Library) | std::queue Knowledge Center
- Complete C++ STL in 1 Video | Time Complexity and Notes | take U forward
- Queue in C++ Standard Template Library (STL) | Geeks for Geeks
- Problems (4):
[E]★ Easy Queue[E]★ Queue[M]★ Team Queue[M]Jzzhu and Children
1.9.6 Priority Queue¶
- ID:
priority_queue· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/priority_queue
- Resources (4):
- ★ C++ Priority Queue | Programiz
- Priority Queue | C++ STL (Standard Template Library) | std::priority_queue Knowledge Center
- Complete C++ STL in 1 Video | Time Complexity and Notes | take U forward
- Priority Queue in C++ Standard Template Library (STL) | Geeks for Geeks
- Problems (9):
[E]★ Priority Queue[E]★ Priority Queue 2[E]★ 8 Use Priority Queue Please[E]★ priority queue minimum[E]Hinata & Priority Queue[E]Powering the Hero (hard version)[M]Room Allocation[M]Task Scheduler[M]Potions (Hard Version)
1.9.7 Deque¶
- ID:
deque· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/deque
- Resources (4):
- ★ C++ Deque | Programiz
- Deque | C++ STL (Standard Template Library) | std::deque Knowledge Center
- Complete C++ STL in 1 Video | Time Complexity and Notes | take U forward
- Deque in C++ Standard Template Library (STL) | Geeks for Geeks
- Problems (9):
[E]★ Implement DeQue[E]Simple deque[E]Deque[E]★ Ada and Queue[E]★ Soldier and Cards[E]E1. Permutation Minimization by Deque[E]Social Network (hard version)[M]Chimpanzini Bananini[H]★ Valeriy and Deque
1.9.8 Set, Unordered Set and Multiset¶
- ID:
set· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/set
- Resources (13):
- ★ Sets | Tech With Tim
- C++ Set | Programiz
- Set | C++ STL (Standard Template Library) | std::set 🔥 Knowledge Center
- Set in C++ | TUF
- Set in C++ Standard Template Library (STL) | Geeks for Geeks
- ★ Unordered Set | C++ STL (Standard Template Library) | std::unordered_set 🔥 Knowledge Center
- C++ Unordered Set | Programiz
- Unordered-set in C++ STL | TUF
- Unordered Sets in C++ Standard Template Library | Geeks for Geeks
- ★ Multi Set | C++ STL (Standard Template Library) | std::multiset 🔥 Knowledge Center
- C++ Multiset | Programiz
- Multiset in C++ Standard Template Library (STL) | Geeks for Geeks
- Complete C++ STL in 1 Video | Time Complexity and Notes | take U forward
- Problems (7):
[E]★ Sets-STL[E]★ Distinct Numbers[E]★ Double-Ended Priority Queue[E]★ Concert Tickets[E]Unexpressed[M]★ Collecting Numbers[M]★ Towers
1.9.9 Map and Unordered Map¶
- ID:
map· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/map
- Resources (9):
- ★ Maps | Tech With Tim
- C++ Map | Programiz
- Map | C++ STL (Standard Template Library) | std::map Knowledge Center
- Map in C++ Standard Template Library (STL) | Geeks for Geeks
- ★ C++ Unordered Map | Programiz
- unordered_map in C++ STL | Geeks for Geeks
- Complete C++ STL in 1 Video | Time Complexity and Notes | take U forward
- ★ Blowing up unordered_map, and how to stop getting hacked on it By neal
- [Hindi] CP Course by Luv - Maps
- Problems (18):
[E]★ Maps-STL[E]★ FIGUREFUL[E]★ Frinds and money[E]★ Hay Points[E]★ Tom Riddle's Diary[E]★ Registration System[E]★ The Department of Redundancy Department[E]★ Babelfish[E]★ Sum of Two Values[E]★ Sum of Three Values[E]Boxes Packing[E]★ Sum of Four Values[E]★ Restaurant Customers[E]Ohana Cleans Up[M]★ Subarray Sums II[M]★ Subarray Divisibility[M]★ Homo or Hetero[M]Chef of the Year
1.9.10 Bitset¶
- ID:
bitset· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/bitset
- Resources (1):
- ★ C++ bitset and its application | Geeks for Geeks
- Problems (3):
[E]★ Set Operation[E]★ Ada and Furrows[H]Oddly Similar
1.9.11 List / Linked List¶
- ID:
list· Difficulty: Very Easy · Importance: ★★☆ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/list
- Resources (4):
- ★ List | C++ STL (Standard Template Library) | std::list Knowledge Center
- C++ List | Programiz
- Complete C++ STL in 1 Video | Time Complexity and Notes | take U forward
- List in C++ Standard Template Library (STL) | Geeks for Geeks
- Problems (2):
[E]★ Doubly Linked List[E]★ Vector II
1.10 Leveraging Monotonicity¶
Subcategory ID: leveraging_monotonicity · Topics: 2
1.10.1 Binary Search¶
- ID:
binary_search· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/binary_search
- Templates (1):
- Binary Search.cpp
- Resources (9):
- ★ Binary Search tutorial | Errichto Algorithms
- ★ Binary Search | EDU
- ★ Binary Search | USACO Guide
- ★ Binary Search | CSAcademy
- Binary Search | Programiz
- Binary Search Algorithm in 100 Seconds | Fireship
- Binary Search In One Shot C++ [Hindi]
- Binary search and other "halving" methods | nor
- Binary Search Algorithm | Apna College | [Hindi]
- Problems (44):
[E]★ Binary Search[E]★ Closest to the Left[E]Closest to the Right[E]★ Fast search[E]★ Factory Machines[E]★ Packing Rectangles[E]★ Multiplication Table[E]★ Ropes[E]★ Very Easy Task[E]★ Equation[E]Robin Hood in Town[E]★ Array Division[E]Brightness Begins[E]Queries about less or equal elements[E]Smooth Occlusion[E]Yet Another Problem About Pairs Satisfying an Inequality[M]★ Maximum Median[M]★ Splitting an Array[M]Ugly Number III[M]★ Meeting on the Line[M]★ Get together[M]★ Digit Queries[M]Cows in Stalls[M]AGGRCOW - Aggressive cows[M]★ Maximum Average Segment[M]★ Pair Selection[M]Magic Ship[M]★ The Meeting Place Cannot Be Changed[M]★ Interesting Function[M]Magic Powder - 1[M]★ Mafia[M]★ Static Range Frequency[M]Gift Set[M]Project Planning[M]Final Boss[M]Place of the Olympiad[M]Magic Powder - 2[M]Finding Routers[M]Scoring Subsequences[M]Wrong Binary Search[H]★ K-th Sum[H]★ Swap Space[H]Bomb[H]Sensor Optimization Dilemma 2
1.10.2 Two Pointers¶
- ID:
two_pointers· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/two_pointers
- Templates (1):
- Two Pointers.cpp
- Resources (5):
- ★ Two Pointers Method | CF EDU
- ★ Two Pointers | USACO Guide
- 8.1 Two pointers method | CPH
- Two Pointers Technique | Geeks for Geeks
- Visual introduction Two Pointer Algorithm | Data Structure and Algorithm for Coding Interviews | Josh's DevBox
- Problems (21):
[E]★ Merging Arrays[E]★ Segment with Small Sum[E]★ Segment with Big Sum[E]★ Number of Segments with Small Sum[E]Number of Segments with Big Sum[E]★ Sum of Two Values[E]Subarray Sums I[E]Books[E]Cellular Network[E]They Are Everywhere[E]Eating Candies[E]★ Three Parts of the Array[E]★ Playlist[E]★ Sum of Three Values[E]★ Subarray Distinct Values[E]★ Sum of Four Values[M]Number of Pairs[M]★ Split[M]★ Segments with Small Set[M]★ Segments with Small Spread[M]Quiz Master
1.11 Basic Sorting Algorithms¶
Subcategory ID: basic_sorting_algorithms · Topics: 8
1.11.1 Bubble Sort¶
- ID:
bubble_sort· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/bubble_sort
- Templates (1):
- Bubble Sort.cpp
- Resources (3):
- ★ Bubble Sort | Programiz
- ★ Bubble Sort Visualization | Bubble Sort Animation Video | Log2Base2
- ★ Sorting Algorithm Visualizer | VisuAlgo
- Problems (2):
[E]★ Sorting: Bubble Sort[E]Bubble Sort
1.11.2 Selection Sort¶
- ID:
selection_sort· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/selection_sort
- Templates (1):
- Selection Sort.cpp
- Resources (3):
- ★ Selection Sort Algorithm | Programiz
- ★ Selection Sort Animation | Ravindu Sachintha
- ★ Sorting Algorithm Visualizer | VisuAlgo
- Problems (1):
[E]★ Selection Sort
1.11.3 Insertion Sort¶
- ID:
insertion_sort· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/insertion_sort
- Templates (1):
- Insertion Sort.cpp
- Resources (3):
- ★ Insertion Sort Algorithm | Programiz
- ★ Insertion Sort Explained using Animations | bvdl․io
- ★ Sorting Algorithm Visualizer | VisuAlgo
- Problems (1):
[E]★ Insertion Sort
1.11.4 Counting Sort¶
- ID:
counting_sort· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/counting_sort
- Templates (1):
- Counting Sort.cpp
- Resources (3):
- ★ Counting Sort Algorithm | Programiz
- ★ Counting Sort Animation | Intuition | Algorithm | Visualization | Shreyaans Jain
- ★ Sorting Algorithm Visualizer | VisuAlgo
- Problems (2):
[E]★ Counting Sort 2[E]The Full Counting Sort
1.11.5 Merge Sort¶
- ID:
merge_sort· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/merge_sort
- Templates (1):
- Merge Sort.cpp
- Resources (5):
- ★ Merge Sort Algorithm | Programiz
- ★ Understanding Mergesort: Sorting Made Simple | Recursion Series | WilliamFiset
- ★ Merge Sort | Manim Animation [4K] | CuriousWalk
- MERGE SORT ALGORITHM | Sorting Algorithm | DSA | GeeksforGeeks
- ★ Sorting Algorithm Visualizer | VisuAlgo
- Problems (4):
[E]★ Merge sort[E]★ Inversion Count[M]Merge Sort 2[M]★ Bubble Sort?
1.11.6 Quick Sort¶
- ID:
quick_sort· Difficulty: Very Easy · Importance: ★★☆ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/quick_sort
- Templates (1):
- quick-sort
- Resources (4):
- ★ Quicksort Algorithm | Programiz
- ★ Quick Sort [Visual Explanation] | Manim Animation [4K] | CuriousWalk
- QUICK SORT | Sorting Algorithms | DSA | GeeksforGeeks
- ★ Sorting Algorithm Visualizer | VisuAlgo
- Problems (1):
[E]★ Quick Sort
1.11.7 Radix Sort¶
- ID:
radix_sort· Difficulty: Very Easy · Importance: ★☆☆ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/radix_sort
- Templates (1):
- radix-sort
- Resources (3):
- ★ Radix Sort Algorithm | Programiz
- ★ Radix Sort | GeeksforGeeks
- ★ Sorting Algorithm Visualizer | VisuAlgo
- Problems (1):
[E]★ Radix Sort
1.11.8 C++ STL Sort and Custom Comparator¶
- ID:
stl_sort· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/stl_sort
- Resources (3):
- ★ Sort in C++ Standard Template Library (STL) | Geeks for Geeks
- ★ Custom Comparators | USACO Guide
- All sorting algorithms at one place | Programiz
- Problems (19):
[E]★ Simple Sorting[E]★ Sorting: Comparator[E]★ 2D-SORT[E]★ Sorting Tuples[E]★ A problem of sorting[E]★ Restaurant Customers[E]Sort the Array[E]★ Parity Sort[E]Bogosort[E]Little Pony and Sort by Shift[E]Reverse Sort[E]★ Indian Summer[E]Rank List[M]★ The Smallest String Concatenation[M]★ Big Sorting[M]★ Double Sort[M]★ Concatenation of Arrays[H]Nezzar and Symmetric Array[H]Correct Placement
1.12 Divide and Conquer¶
Subcategory ID: divide_and_conquer · Topics: 1
1.12.1 Divide and Conquer¶
- ID:
divide_and_conquer· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/divide_and_conquer
- Resources (2):
- ★ Divide and Conquer: The Art of Breaking Down Problems | Recursion Series | WilliamFiset
- Divide and Conquer Algorithm | Programiz
- Problems (4):
[E]★ Inversion Count[E]★ Print The Pattern[M]★ Merge Sort?[H]Ada and Species
1.13 Greedy and Constructive¶
Subcategory ID: greedy_and_constructive · Topics: 2
1.13.1 Basic Greedy Algorithms¶
- ID:
greedy_algorithms· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/greedy_algorithms
- Resources (3):
- ★ Introduction to Greedy Algorithms | USACO Guide
- ★ Greedy Algorithms with Sorting | USACO Guide
- Greedy Algoritm by Abdul Bari
- Problems (25):
[E]★ Studying Algorithms[E]★ Increasing Array[E]★ Ferris Wheel[E]★ Tasks and Deadlines[E]Reading Books[E]USB vs. PS/2[E]★ Increasing Triplet Subsequence[E]Movie Festival[M]★ Two Sets[M]Mad Scientist[M]Stick Lengths[M]★ Towers[M]★ Maximum Subarray Sum[M]The Party and Sweets[M]★ Did We Get Everything Covered?[M]Grouping Increases[M]★ Matching Arrays[M]★ Least Prefix Sum[M]Sets and Union[M]Robert Hood and Mrs Hood[M]Quests[H]★ Money Buys Less Happiness Now[H]★ Missing Coin Sum[H]Kevin and Numbers[H]Apartments
1.13.2 Basic Constructive Algorithms¶
- ID:
constructive_algorithms· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/constructive_algorithms
- Resources (3):
- ★ Constructive Algorithms | Percy Wong
- Tips on Constructive Algorithms By ReaLNero
- Complete Constructive Problems Practice - Noob to Expert | Topic Stream 5 | Colin Galen
- Problems (22):
[E]★ Special Permutation[E]★ EhAb AnD gCd[E]★ Construct the String[E]★ Permutations[E]★ Lesha and array splitting[E]★ Palindrome Reorder[E]GCD vs LCM[E]★ Unnatural Conditions[E]K-divisible Sum[E]Shoe Shuffling[E]Corrupted Array[E]Fun Permutation[M]LCM Problem[M]★ Two Sets[M]★ A BIT of a Construction[M]k-LCM (hard version)[M]Constructing the Array[M]★ Ehab and Prefix MEXs[M]★ Prefix Flip (Hard Version)[M]★ Multiples of Length[M]Manhattan Permutations[H]Trip to the Olympiad
1.14 2D Prefix Sum¶
Subcategory ID: 2d_prefix_sum · Topics: 1
1.14.1 2D Prefix Sum¶
- ID:
2d_prefix_sum· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/2d_prefix_sum
- Templates (1):
- Prefix Sum 2D.cpp
- Resources (2):
- ★ More on Prefix Sums | USACO Guide
- Prefix Sum of Matrix (Or 2D Array) | Geeks for Geeks
- Problems (11):
[E]★ Forest Queries[E]★ range sum 2d[E]★ Counting Rectangles[E]Painting the Barn[E]The Lazy Cow[E]Matrix Block Sum[M]Tic Tac Toe[M]★ Beauty of the mountains[M]★ Counting Test[H]Smilo and Minecraft[VH]Hits Different
1.15 More Techniques¶
Subcategory ID: more_techniques · Topics: 2
1.15.1 Difference Array¶
- ID:
difference_array· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/difference_array
- Resources (4):
- ★ An Introduction To Difference Arrays By arujbansal
- Understanding Difference Array: The Underrated Constant Time Range Update Algorithm (Part 1) | Ishank Katiyar
- Difference Array Technique | Tutorial | Range Updates | Competitive Programming Tricks Part 1
- Prefix Sums and Difference Array: 20 minutes of EVERYTHING you need to know by Algorithms with Shayan
- Problems (12):
[E]★ Karen and Coffee[E]★ Array Manipulation[E]★ Restaurant Customers[E]★ Encrypting Messages[E]Approximating a Constant Range[E]Substr Swap[M]★ Greg and Array[M]★ Little Girl and Maximum Sum[M]Turn Off The TV[M]★ Cherry and Bits[M]Difference Array[H]QED's Favorite Permutation
1.15.2 Sliding Window Technique¶
- ID:
sliding_window_technique· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/sliding_window_technique
- Resources (2):
- ★ Mastering Sliding Window Techniques | Ankit Singh
- ★ Sliding Window | USACO Guide
- Problems (6):
[E]★ Sliding Window Minimum[E]2^Sort[M]★ Sliding Window Median[M]★ Mex Min[H]★ Deque-STL[H]Tactical Removal
1.16 Bit Manipulation¶
Subcategory ID: bit_manipulation · Topics: 2
1.16.1 Bit Manipulation¶
- ID:
bit_manipulation· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/bit_manipulation
- Prerequisites: Complete the Bitwise Operations and Bitmasks topic first.
- Templates (1):
- Bitwise Operations.cpp
- Resources (4):
- ★ Bit manipulation | CP Algorithms
- ★ Intro to Bitwise Operators | USACO Guide
- Some equations using bitwise operators! By srlabib
- Bit Manipulation Playlist by Striver
- Problems (32):
[E]★ Bits[E]★ XORwice[E]★ Bitwise Operators[E]★ And Then There Were K[E]★ AND 0, Sum Big[E]★ Bitwise Tuples[E]★ AND Sorting[E]★ Cat, Fox and the Lonely Array[M]★ XOR on Segment[M]★ Interesting Array[M]★ Make It Beautiful[M]★ AND, OR and square sum[M]★ Red Scarf[M]★ Sum vs XOR[M]★ The Great XOR[M]Turtle and an Infinite Sequence[M]★ MEXor Mixup[M]★ Rock and Lever[M]★ Johnny and His Hobbies[M]★ And It's Non-Zero[M]★ Powers Of Two[M]Make Good[M]★ Xor Sum 4[M]★ AND Sequences[M]★ Ehab the Xorcist[M]Dima and a Bad XOR[M]★ The Wu[M]★ Sum of XOR Functions[M]Take a Guess[M]Prime XOR Coloring[M]Boneca Ambalabu[H]★ Queries
1.16.2 The XOR Trick¶
- ID:
the_xor_trick· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/the_xor_trick
- Resources (1):
- ★ That XOR Trick | florian
- Problems (4):
[E]Lonely Integer[E]★ Missing Number[M]★ Red Scarf[M]Data Structures Fan
1.17 Basic Modular Arithmetic¶
Subcategory ID: modular_arithmetic · Topics: 2
1.17.1 Binary Exponentiation and Basic Modular Arithmetic¶
- ID:
binary_exponentiation· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/binary_exponentiation
- Templates (1):
- Binary Exponentiation.cpp
- Resources (4):
- ★ Computations Modulo P in Competitive Programming | Errichto
- ★ Modular Arithmetic for Beginners By Spheniscine
- ★ Binary Exponentiation | CP Algorithms
- Modular Arithmetic | USACO Guide
- Problems (14):
[E]★ Exponentiation[E]MODEX[E]Big Mod[E]★ The last digit[E]★ Count Good Numbers[E]Tiles[E]★ Just Add It[E]★ Modular Exponentiation[E]★ Factorial Under Modulo[E]Kaosar loves Polynomials[M]★ Leading and Trailing[M]★ Chef and Riffles[M]Kill Demodogs[H]★ Magic of the locker
1.17.2 Fermat's Little Theorem and Modular Inverse¶
- ID:
fermats_little_theorem· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/fermats_little_theorem
- Resources (3):
- Fermat's little theorem | Wiki
- ★ Proof of Fermat's Little Theorem By Chris Caldwell
- ★ Modular Multiplicative Inverse | forthright48
- Problems (2):
[E]★ Modular division[E]★ Exponentiation II
1.18 Basic Counting¶
Subcategory ID: basic_counting · Topics: 3
1.18.1 Permutations, Combinations and Basic Counting Problems¶
- ID:
permutations_and_combinations· Difficulty: Very Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/permutations_and_combinations
- Templates (1):
- Binomial Coefficients.cpp
- Resources (4):
- ★ 14.2 Counting with Permutations and Combinations
- Discrete Math II/Combinatorics (Entire course) | Playlist by Kimberly Brehm
- Combinatorics | USACO Guide
- Binomial Coefficients | CP Algorithms
- Problems (20):
[E]★ Bit Strings[E]★ Binomial Coefficients[E]★ Creating Strings II[E]★ Distributing Apples[E]★ Beautiful Numbers[E]★ Two Knights[E]Card Game[E]Number of Ways[E]Hossam and Combinatorics[E]★ Sherlock and Permutations[M]Ada and Teams[M]Good Predictions[M]How Does the Rook Move?[M]★ Battling with Numbers[M]★ Advertising Agency[M]Merging the Sets[M]Make it Alternating[H]Curious Array[H]Placing Jinas[H]★ Selection Sort Count
1.18.2 Stars and Bars¶
- ID:
stars_and_bars· Difficulty: Very Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/stars_and_bars
- Resources (2):
- ★ Stars and bars | CP Algorithms
- Stars and Bars (and bagels) - Numberphile
- Problems (10):
[E]★ Problem Makes Problem[E]★ Array[E]★ Kyoya and Colored Balls[E]★ Distributing Apples[M]★ Greedy Walking[M]★ Two Arrays[M]Marbles[M]One-Dimensional Puzzle[H]★ Roaming[H]★ Factorization
1.18.3 Pigeonhole Principle¶
- ID:
pigeonhole_principle· Difficulty: Very Easy · Importance: ★★☆ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/pigeonhole_principle
- Resources (3):
- ★ Pigeonhole Principle | Geeks for Geeks
- What Is the Pigeonhole Principle? | Spanning Tree
- Pigeonhole Principle | Brilliant
- Problems (8):
[E]★ Kuroni and Impossible Calculation[E]★ Funny Game[M]★ Halloween treats[M]★ Going Home[M]Prinzessin der Verurteilung[M]★ XOR This OR That[M]★ Modulo Sum[M]Palindrome
1.19 Very Basic Graphs¶
Subcategory ID: very_basic_graphs · Topics: 1
1.19.1 Introduction to Graphs | Definitions and Representations¶
- ID:
graph_representations· Difficulty: Very Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/graph_representations
- Resources (11):
- ★ A Gentle Introduction To Graph Theory | Vaidehi Joshi
- Introduction to Graph Theory: A Computer Science Perspective | Reducible
- ★ Graph Theory Introduction WilliamFiset
- ★ Chapter 11 Basics of graphs | CPH
- Introduction to graph theory | CSAcademy
- Graph representation | CSAcademy
- Graph Representation | HackerEarth
- গ্রাফ থিওরিতে হাতেখড়ি – ১ | শাফায়েতের ব্লগ
- গ্রাফ থিওরিতে হাতেখড়ি – ২ (ভ্যারিয়েবলে গ্রাফ স্টোর-১) | শাফায়েতের ব্লগ
- গ্রাফ থিওরিতে হাতেখড়ি – ৩ (ভ্যারিয়েবলে গ্রাফ স্টোর-২) | শাফায়েতের ব্লগ
- Introduction to Graphs | USACO Guide
- Problems (5):
[E]★ Graph[E]★ Network Topology[E]Find Center of Star Graph[E]Minimum Number of Vertices to Reach All Nodes[M]Road Construction
2. Data Structures (DS)¶
Category ID: data_structures · Subcategories: 18 · Topics: 82
2.1 Segment Tree¶
Subcategory ID: segment_tree · Topics: 13
2.1.1 Segment Tree (Point Update Range Query)¶
- ID:
segment_tree· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/segment_tree
- Templates (1):
- Segment Tree.cpp
- Resources (3):
- ★ Segment Tree Part 1 | CF EDU
- ★ Segment Trees | CS Academy
- ★ Simplest form of a Segment Tree and some variations | CP Algorithms
- Problems (38):
[E]★ Segment Tree for the Sum[E]★ Segment Tree for the Minimum[E]★ Number of Minimums on a Segment[E]★ Inversions[E]★ Salary Queries[E]Enemy is weak[E]Mega Inversions[E]★ K-query[E]Pashmak and Parmida's problem[E]★ Legacy[E]★ Second Largest Query[M]Number of Inversions on Segment[M]★ Add Arithmetic Progression On Segment[M]★ Distinct Characters Queries[M]★ Distinct Values Queries[M]Xenia and Bit Operations[M]★ Sereja and Brackets[M]Points[M]★ Ant colony[M]★ Interesting Array[M]Infinite Inversions[M]★ Subsequences[M]★ SUM and REPLACE[M]Hotel Queries[M]★ Increasing subsequence II[M]List Removals[M]★ On Changing Tree[M]★ Yaroslav and Divisors[M]Propagating tree[M]Bash and a Tough Math Puzzle[M]★ Alternating String[M]Ksyusha and the Loaded Set[M]★ Max GEQ Sum[H]★ Can you answer these queries III[H]★ REQ[H]Misha and Permutations Summation[H]Linear Kingdom Races[H]Incessant Rain
2.1.2 Segment Tree with Lazy Propagation¶
- ID:
segment_tree_with_lazy_propagation· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/segment_tree_with_lazy_propagation
- Templates (1):
- Segment Tree Lazy.cpp
- Resources (2):
- ★ Segment Tree Part 2 | CF EDU
- ★ Range updates (Lazy Propagation) | CP Algorithms
- Problems (32):
[E]★ Addition and Sum[E]★ Addition and Minimum[E]Circular RMQ[E]Multiplication and Sum[E]★ Assignment and Sum[E]Prefix Sum Queries[E]★ The Child and Sequence[E]★ Two Sequence Queries[E]Range Update Point Query[M]★ Range Updates and Sums[M]★ Range Affine Range Sum[M]★ Bitwise OR and AND[M]★ Inverse and K-th one[M]Addition and First element at least X[M]Assignment and Maximal Segment[M]Kefa and Watch[M]★ A Simple Task[M]★ XOR on Segment[M]★ Polynomial Queries[M]Lucky Queries[M]Boring Segments[M]Random Update Query[M]MEX Queries[M]Diverging Directions[H]DZY Loves Fibonacci Numbers[H]★ Please, another Queries on Array?[H]Linear Kingdom Races[H]★ Queries[H]Greedy Subsequences[H]Addition Robot[H]Wine Factory (Easy Version)[H]Serge and Dining Room
2.1.3 Persistent Segment Tree¶
- ID:
persistent_segment_tree· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/persistent_segment_tree
- Templates (1):
- Segment Tree Persistent.cpp
- Resources (3):
- ★ Persistent Segment Tree by Oliver-Matis Lill
- ★ Persistent Segment Tree | CP Algorithms
- Persistence Made Simple by hikarico
- Problems (24):
[E]★ Range Queries and Copies[E]★ K-Query Online[E]★ K-th Number[E]Kth Number[E]★ To the moon[M]★ Distinct Values Queries[M]★ Till I Collapse[M]Functions On The Segments[M]★ Sign on Fence[M]★ Count on a tree[M]Forbidden Sum[M]Chef and Prime Queries[M]★ Hossam and Range Minimum Query[M]★ Smaller Sum[M]Army Creation[M]★ One Occurrence[M]G2. Big Wins! (hard version)[H]★ Boring Queries[H]★ Function! Not Again!![H]★ Cloning[H]★ The Classic Problem[H]★ Frequency Mismatch (Hard Version)[H]Odd Mineral Resource[VH]Noble Knight's Path
2.1.4 Persistent Segment Tree with Lazy Propagation¶
- ID:
persistent_segment_tree_with_lazy_propagation· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/persistent_segment_tree_with_lazy_propagation
- Templates (1):
- Segment Tree Persistent Lazy.cpp
- Resources (1):
- ★ Persistence Made Simple - Persistent Lazy Propagation by hikarico
- Problems (4):
[E]★ To the moon[M]Observing the Tree[H]SubInversing[VH]Fibonacci Numbers on Tree
2.1.5 2D Segment Tree¶
- ID:
2d_segment_tree· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/2d_segment_tree
- Resources (3):
- ★ Generalization to higher dimensions | CP Algorithms
- 2D segment Tree by papa-ka-para
- 2D Segment Tree | Pavel Mavrin (Pashka)
- Problems (9):
[E]★ Forest Queries II[E]★ Vanya and Treasure[E]★ Rectangle Sum[E]★ Point Add Rectangle Sum[M]★ Map[H]★ The Ultimate Bamboo Eater[H]★ The Untended Antiquity[H]★ Games[VH]Pairs
2.1.6 Dynamic Segment Tree¶
- ID:
dynamic_segment_tree· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/dynamic_segment_tree
- Resources (3):
- ★ Dynamic Segment Tree | CP Algorithms
- ★ Sparse Segment Trees | USACO Guide
- Dynamic Segment Trees : Online Queries for Range Sum with Point Updates | Geeks for Geeks
- Problems (5):
[E]★ Salary Queries[E]★ K-query[M]★ Distinct Values Queries[M]★ Monkey and Apple-trees[M]Game of Pieces
2.1.7 2D Dynamic Segment Tree¶
- ID:
2d_dynamic_segment_tree· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/2d_dynamic_segment_tree
- Templates (1):
- Segment Tree 2D Dynamic.cpp
- Resources (1):
- IOI 2013 - Game Solution | USACO Guide
- Problems (1):
[H]★ Games
2.1.8 Merge Sort Tree¶
- ID:
merge_sort_tree· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/merge_sort_tree
- Templates (1):
- 122263
- Resources (3):
- ★ Merge Sort Tree - Tutorial | arunnsit
- ★ Merge Sort Tree (and similar stuff) | By Abito
- Point Updates in Merge Sort Trees By suvro_coder
- Problems (5):
[E]★ K-query[E]★ Valera and Queries[E]★ Salary Queries[E]★ Range Kth Smallest[M]★ Smaller Sum
2.1.9 Iterative Segment Tree¶
- ID:
iterative_segment_tree· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/iterative_segment_tree
- Templates (1):
- Segment Tree NonRecursive.cpp
- Resources (2):
- ★ Efficient and easy segment trees
- Sort before insert — A small extension to Merge sort tree By darkkcyan
2.1.10 Segment Tree Merging¶
- ID:
segment_tree_merging· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/segment_tree_merging
- Templates (1):
- Segment Tree Merging.cpp
- Resources (2):
- ★ Segment Tree Merging | Yet Another Competitive Programming Blog
- using merging segment tree to solve problems about sorted list | TLE
- Problems (8):
[M]★ Range Sort Query (Solve using Segment Tree Merging)[H]Task Tree Rotations (rot)[H]★ Combat on a tree[VH]Task Tree Rotations 2 (rod)[VH]★ Minimax[VH]★ Phoenix and Bits[VH]violent writing[VH]destiny
2.1.11 Segment Tree Beats¶
- ID:
segment_tree_beats· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/segment_tree_beats
- Templates (1):
- Segment Tree Beats.cpp
- Resources (4):
- ★ Segment Tree Beats: Segment Tree On Steroids. Part 1 | peltorator
- ★ A simple introduction to "Segment tree beats" | jiry_2
- Segment tree beats | IOI preparation #6 | Errichto
- AlgorithmsThread 4: Segment Tree Beats
- Problems (18):
[E]★ The Child and Sequence[E]Gorgeous Sequence[E]★ Minimize![E]★ Minimize, add![M]I like Query Problem[M]★ Range Chmin Chmax Add Range Sum[M]★ And or Max[M]Bear and Bad Powers of 42[M]Little Pony and Lord Tirek[M]Julia the snail[M]Nagini[M]Box Operations[M]★ Good Subsegments[H]Minimize, add, GCDize and their friends[H]★ New Year’s Day Old Man and Sequence[H]Stations[H]Overflow[VH]Tsinghua Training Camp 2015V
2.1.12 XOR Segment Tree¶
- ID:
xor_segment_tree· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/xor_segment_tree
- Templates (1):
- XOR Segment Tree.cpp
- Resources (1):
- ★ [Tutorial] XOR Segment Tree | PurpleCrayon
- Problems (5):
[E]★ xor^2[E]★ Swap and Maximum Block[M]★ Static Xor Range Composite Query[M]Minimal String Xoration[M]Reverse and Swap
2.1.13 Historic Information on Segment Trees¶
- ID:
historic_information_on_segment_trees· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/historic_information_on_segment_trees
- Prerequisites: Segment Tree Beats
- Resources (3):
- ★ Historic Information on Segment Trees | mzhang2021
- ★ A simple introduction to "Segment tree beats" By jiry_2
- ★ [Tutorial] A Bit of Math, Historic Sum, and Range Add Range Sum Binary Indexed Tree (Fenwick Tree) By FHVirus
- Problems (2):
[H]Paimon Segment Tree[VH]Tsinghua Training Camp 2015V
2.2 Binary Indexed Tree (BIT)¶
Subcategory ID: binary_indexed_tree · Topics: 5
2.2.1 BIT / Fenwick Tree¶
- ID:
bit· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/bit
- Templates (1):
- BIT.cpp
- Resources (5):
- ★ Fenwick Tree | CP Algorithms
- BINARY INDEXED TREES | Topcoder
- Fenwick Tree | CS Academy
- Fenwick Trees | Algorithms Live!
- Fenwick Tree | Pavel Mavrin (Pashka)
- Problems (22):
[E]★ Curious Robin Hood[E]★ Range Update Queries[E]★ Salary Queries[E]★ Inversions[E]★ K-query[E]Mega Inversions[E]★ Crayon[E]Pashmak and Parmida's problem[E]Enemy is weak[E]Tufurama[M]★ Distinct Values Queries[M]List Removals[M]Number of Inversions on Segment[M]★ Distinct Characters Queries[M]★ Ball[M]★ SUM and REPLACE[M]★ Yaroslav and Divisors[M]★ Increasing subsequence II[M]★ Nested Ranges Count[M]Sum Over Zero[H]Ada and Species[H]★ REQ
2.2.2 Lower bound on BIT¶
- ID:
lower_bound_on_bit· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/lower_bound_on_bit
- Templates (1):
- 61364#:~:text=an intuitive proof.-,Implementation,-:
- Resources (1):
- ★ [Tutorial] Searching Binary Indexed Tree in O(log(N)) using Binary Lifting
- Problems (5):
[E]★ War Games 2.1[E]Multiset[E]Order Statistic Set[E]Dynamic Collection[M]Nastya and King-Shamans
2.2.3 BIT with Range Update and Range Query¶
- ID:
bit_with_range_update_and_range_query· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/bit_with_range_update_and_range_query
- Templates (1):
- BIT with Range Update and Range Query.cpp
- Resources (2):
- ★ Range Updates and Range Queries | CP Algorithms
- Fenwick tree range updates | Petr
- Problems (2):
[E]★ Addition and Sum[H]★ Please, another Queries on Array?
2.2.4 2D BIT¶
- ID:
2d_bit· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/2d_bit
- Resources (4):
- ★ BINARY INDEXED TREES | Topcoder
- Finding sum in two-dimensional array | CP Algorithms
- ★ Easy implementation of Compressed 2D Binary Indexed Tree for grid of binary numbers[Tutorial]
- ★ 2D BIT | USACO Guide
- Problems (10):
[E]★ Forest Queries II[E]Mobile phones[E]Points in Rectangle[M]★ Anton and Permutation[M]★ Counting In Byteland (3D)[M]Intersection of Permutations[M]A. Boring Class[H]Crowded Cities[H]Goodbye Souvenir[VH]Pairs
2.2.5 2D BIT with Range Update and Range Query¶
- ID:
2d_bit_with_range_update_and_range_query· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/2d_bit_with_range_update_and_range_query
- Templates (1):
- BIT 2D with Range Update and Range Query.cpp
- Resources (2):
- ★ A bit more of general ideas By adamant
- A New Algorithm for Updating and Querying Sub-arrays of Multidimensional Arrays | Paper
- Problems (4):
[E]★ Update Sub-Matrix & Query Sub-Matrix[E]Чипполино[H]★ Iahub and Xors[H]★ The Untended Antiquity
2.3 Sparse Table¶
Subcategory ID: sparse_table · Topics: 3
2.3.1 Sparse Table¶
- ID:
sparse_table· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/sparse_table
- Templates (1):
- Sparse Table.cpp
- Resources (5):
- ★ Sparse Table | CP Algorithms
- ★ Sparse Table Data Structure | WilliamFiset
- Sparse Table & RMQ (Range Minimum Query) | Errichto
- Sparse Table | Aditya Biswakarma
- Sparse table | Mike Koltsov
- Problems (12):
[E]★ Static Range Minimum Queries[E]Catapult that ball[E]★ Maximum modulo equality[M]★ Ant colony[M]Sereja and D[M]★ CGCDSSQ[M]R2D2 and Droid Army[M]Trains and Statistic[M]★ Array Stabilization (GCD version)[M]★ Longest Good Segment[M]Old Christmas Lights[M]Shopping
2.3.2 Sparse Table 2D¶
- ID:
sparse_table_2d· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/sparse_table_2d
- Templates (1):
- Sparse Table 2D.cpp
- Resources (2):
- ★ 2D Range Minimum Query in O(1) | fnf47
- 2D Range Minimum Query in O(1) | Geeks for Geeks
- Problems (4):
[M]★ Animals and Puzzle[M]Cherry and Squares[M]Chef and Rectangle Array[M]★ Map
2.3.3 Disjoint Sparse Table¶
- ID:
disjoint_sparse_table· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/disjoint_sparse_table
- Templates (1):
- Disjoint Sparse Table.cpp
- Resources (3):
- ★ [Tutorial] Disjoint Sparse Table | nilesh3105
- Video about Disjoint Sparse Table or how to answer all queries in constant time | peltorator
- Disjoint Sparse Table tutorial | ramchandra
- Problems (4):
[E]★ Product on the segment by modulo[E]★ Count maxima on an interval[H]★ Calculate MARS[H]Maximize MARS
2.4 Trie¶
Subcategory ID: trie · Topics: 2
2.4.1 Trie on Strings and Bits¶
- ID:
trie· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/trie
- Templates (1):
- Trie.cpp
- Resources (4):
- ★ Trie series | Striver
- Introduction to Trie – Data Structure and Algorithm Tutorials | Geeks for Geeks
- Trie | Principles of Algorithmic Problem Solving
- ★ Bitwise Trie | Lalit Kundu
- Problems (39):
[E]★ Ada and Indexing[E]★ Try to complete[E]Karuta[E]Query On Strings[E]★ Shortest Names[E]★ Order of Digits[E]★ Vasiliy's Multiset[E]Hyper Prefix Sets[E]★ Set Xor-Min[E]★ SubXor[E]★ Beautiful Subarrays[E]XOR[E]Sausage Maximization[E]Choosing The Commander[E]★ Xor Submatrix[E]Yet Another XOR Problem[E]★ Good Substrings[E]Phone List[E]★ Shorten the Array[M]Vitya and Strange Lesson[M]★ Word Combinations[M]A Lot of Games[M]Vlak[M]Type Printer[M]★ XOR Game[M]★ Short Code[M]★ Another Word Game[M]★ XOR Inverse[M]★ Find and Replace[M]★ Chef and String[M]★ Vishon XOR[M]★ Lisa and the Martians[M]★ array-value[M]★ Yasya and the Mysterious Tree[M]Fixed Prefix Permutations[M]Weird Sum[H]Tree and XOR[H]★ Selling RNA Strands[H]★ Comfortably Numb
2.4.2 Persistent Trie¶
- ID:
persistent_trie· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/persistent_trie
- Templates (1):
- Persistent Trie.cpp
- Resources (2):
- Persistent Trie | Geeks for Geeks
- Persistent Trie - Codechef - GothamPD | Gaurav Sen
- Problems (7):
[M]★ Xor Queries[M]★ Know Your Statement[M]★ Yet Another XOR Tree Problem[M]★ Klasika[M]★ Jontrona of Liakot[H]Gotham PD[H]★ XOR Is Fun
2.5 Disjoint Set Union (DSU)¶
Subcategory ID: dsu · Topics: 8
2.5.1 DSU / Union Find¶
- ID:
dsu· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/dsu
- Templates (2):
- DSU.cpp
- unionfind_ds.cpp
- Resources (9):
- ★ Disjoint Set Union | CP Algorithms
- ★ Union Find - Union and Find Operations WilliamFiset
- ★ Disjoint-set Data Structures | CS Academy
- ★ Disjoint Sets Union | CF EDU
- G-46. Disjoint Set | Union by Rank | Union by Size | Path Compression | striver
- DISJOINT-SET DATA STRUCTURES | Topcoder
- Introduction to Disjoint Set Data Structure | DSU by kartik8800
- [Tutorial] Proving the inverse Ackermann complexity of Union-Find By -is-this-fft-
- DSU Extensions with Auxillary Nodes : Move and Erase
- Problems (30):
[E]★ Unionfind[E]★ Road Construction[E]Parking[E]★ Cutting a graph[E]Consecutive Letters[E]★ Anansi's Cobweb[E]★ Ancient Berland Roads[E]Bosses[E]Roads not only in Berland[E]★ Experience[E]★ Quantity of Strings[E]Mocha and Diana (Easy Version)[E]Mahmoud and a Dictionary[E]Reachability Query[M]★ Unbelievable Array[M]★ Bipartite Graph[M]Two Sets[M]★ Wormhole Sort[M]Moocast[M]Mountain Time[M]★ Restructuring Company[M]★ Path Queries[M]Road Reform[M]★ MinOr Tree[M]Non-Decreasing Colorful Path[M]★ GCD Counting[M]★ Mocha and Diana (Hard Version)[M]Omg Graph[H]Strongest Friendship Group[H]★ Imbalance Value of a Tree
2.5.2 DSU with Rollbacks¶
- ID:
dsu_with_rollbacks· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/dsu_with_rollbacks
- Templates (1):
- DSU with Rollbacks.cpp
- Resources (2):
- DSU With Rollback | Usaco Guide
- Rollback Idea on Union Find By Vivek Gupta
- Problems (3):
[E]★ DSU with rollback[E]Inaho[M]★ Persistent Unionfind
2.5.3 Reachability Tree / DSU Tree / Kruskal Reconstruction Tree (KRT)¶
- ID:
reachability_tree· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/reachability_tree
- Templates (1):
- Reachability Tree.cpp
- Resources (3):
- ★ Kruskal Reconstruction Tree | Yet Another Competitive Programming Blog
- ★ [Tutorial] Reachability Tree / DSU-tree | prabowo
- Merging Queries Trick By SlavicG
- Problems (11):
[E]★ Qpwoeirut and Vertices[M]★ Graph and Queries[M]★ Pictionary[M]Chefina and Strange Tree[M]Black Cats Deployment[H]★ Tiptoe through the tulips[H]★ Groceries in Meteor Town[H]Swapping Cities[H]Ski Course Rating[H]Smooth Sailing (Hard Version)[H]Digital Village (Extreme Version)
2.5.4 Partially Persistent DSU¶
- ID:
partially_persistent_dsu· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/partially_persistent_dsu
- Templates (1):
- DSU Partially Persistent.cpp
- Resources (1):
- A quite interesting trick involving Disjoint Set Union by stefdasca
- Problems (5):
[E]★ New Roads Queries[M]Mountaineers[M]Particle Swapping[M]Jet Trains[M]Osama-utiful Components
2.5.5 Persistent DSU¶
- ID:
persistent_dsu· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/persistent_dsu
- Templates (1):
- Persistent UnionFind.cpp
- Resources (1):
- [Tutorial] Persistent DSU made trivial | sword060
- Problems (3):
[E]★ New Roads Queries[M]★ Persistent Unionfind[M]Osama-utiful Components
2.5.6 Augmented DSU / Weighted DSU¶
- ID:
augmented_dsu· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/augmented_dsu
- Templates (1):
- Augmented DSU.cpp
- Resources (2):
- ★ Augmented DSU | Arpit Gupta
- Atcoder Good Set Query Problem Editorial by en_translator
- Problems (6):
[E]★ Good Set Query[E]★ Strange Food Chain[E]Parity[E]Mahmoud and a Dictionary[E]Unionfind with Potential[M]★ XOR, Tree, and Queries
2.5.7 DSU on Tree and Small to Large Merging¶
- ID:
dsu_on_tree· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/dsu_on_tree
- Templates (1):
- DSU on Tree.cpp
- Resources (5):
- ★ DSU on Tree | Small to Large merging | Advanced Idea | Part 4
- 18.4 - Merging Data Structures | Competitive Programming Handbook
- ★ [Explanation] dsu on trees (small to large) | qmk
- [Tutorial] Sack (dsu on tree) | Arpa
- Small-To-Large Merging | Usaco Guide
- Problems (18):
[E]★ Distinct Colors[E]★ Lomsat gelral[E]★ Promotion Counting[E]Tree Requests[E]★ Treediff[E]The Grass Type[E]Blood Cousins Return[E]Dominant Indices[M]★ Tree and Queries[M]The Cost of Speed Limits[M]Making Friends on Joitter is Fun[M]Arpa’s letter-marked tree and Mehrdad’s Dokhtar-kosh paths[M]★ Palindromes in a Tree[M]★ Tree Inversion[M]★ Short Code[M]Beauty and The Tree[M]★ Nim Cheater[H]★ Selling RNA Strands
2.5.8 [Trick] Maintaining Log N DSU / Range Parallel DSU¶
- ID:
maintaining_log_n_dsu· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/maintaining_log_n_dsu
- Resources (2):
- Editorial of Substring Restrictions Problem | CS Academy
- A comment by aryanc403
- Problems (5):
[M]★ Range Parallel Unionfind[M]★ Substring Restrictions[M]★ Listing Passwords[M]★ Kuroni and the Cowsheds[M]★ Palindrome Construction
2.6 Square Root Decomposition¶
Subcategory ID: sqrt_decomposition · Topics: 12
2.6.1 Basic SQRT Decomposition¶
- ID:
sqrt_decomposition· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/sqrt_decomposition
- Resources (6):
- ★ Sqrt Decomposition | CP Algorithms
- ★ Square Root Decomposition | USACO Guide
- 27 - Square Root Algorithms | Competitive Programming Handbook
- ★ Sqrt Decomposition | Errichto
- What is Square Root Decomposition? - Range Query Solving | Gaurav Sen
- Square root decomposition topic summary | Competitive Programming | Vivek Gupta | Advanced
- Problems (18):
[E]★ Curious Robin Hood[E]★ Range Update Queries[E]★ Point Set Range Frequency[E]Gravity Falls[M]★ Range Updates and Sums[M]D-query[M]★ Give Away[M]★ Hill Jumping[M]Beauty and The Tree[M]★ Array Transformer[M]★ Most Frequent Value[M]A. Boring Class[H]★ Dynamic Inversion[H]★ Chef And Easy Xor Queries[H]Chef and Churu[H]★ Welcome home, Chtholly[H]The Tree[H]★ Substrings in a String
2.6.2 Splitting Objects into Light and Heavy / Case Processing¶
- ID:
splitting_objects_into_light_and_heavy· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/splitting_objects_into_light_and_heavy
- Resources (5):
- ★ Combining Algorithms | USACO Guide
- 27.1 - Case Processing | Competitive Programming Handbook
- ★ Light and heavy | Errichto
- ★ sqrt(S) distinct values | Errichto
- Square root decomposition topic summary | Competitive Programming | Vivek Gupta | Advanced
- Problems (14):
[E]★ Little Elephant and Array[E]★ Just Update and Print the array[E]★ Vanya and Treasure[M]★ Subset Sums[M]★ Holes[M]Permutation and Queries[M]★ Train Maintenance[M]Maximum Child Sum[H]★ Propagation[H]Mr. Kitayuta's Colorful Graph[H]Instant Messanger[H]★ Modulo Queries[H]Tree Queries[H]Jaber and the Prediction Tree
2.6.3 Batch Processing / SQRT Decomposition on Queries¶
- ID:
batch_processing· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/batch_processing
- Resources (4):
- ★ Batching | USACO Guide
- ★ 27.1- Batch Processing | Competitive Programming Handbook
- Sqrt decomposition by queries | Errichto
- Square root decomposition topic summary | Competitive Programming | Vivek Gupta | Advanced
- Problems (5):
[E]★ XXXXXXXX[M]★ Serega and Fun[M]★ GCD 2010[M]★ Queries on the Tree[H]Conveyor Belts
2.6.4 SQRT Decomposition Split and Build Technique¶
- ID:
sqrt_decomposition_split_and_build_technique· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/sqrt_decomposition_split_and_build_technique
- Templates (1):
- Square Root Decomposition With Reverse Update.cpp
- Resources (1):
- Square root decomposition topic summary | Competitive Programming | Vivek Gupta | Advanced
- Problems (2):
[M]★ Serega and Fun[H]★ Жесть
2.6.5 SQRT Fragmented Tree / Block Tree / SQRT Decomposition on Trees¶
- ID:
sqrt_fragmented_tree· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/sqrt_fragmented_tree
- Templates (1):
- 20273231
- Resources (1):
- ★ Unknown Data Structure — (Sqrt Fragmented Tree) By cjtoribio
- Problems (1):
[M]★ Queries on the Tree
2.6.6 Mo's Algorithm¶
- ID:
mos_algorithm· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/mos_algorithm
- Templates (1):
- MOs Algorithm.cpp
- Resources (6):
- ★ Mo's algorithm | Mike Koltsov
- ★ Mo's algorithm | CP Algorithms
- [Tutorial] Square root decomposition and applications | box
- ★ Mo's Algorithm | Errichto
- Square root decomposition topic summary | Competitive Programming | Vivek Gupta | Advanced
- An alternative sorting order for Mo's algorithm (Hilbert Order) | gepardo
- Problems (13):
[E]★ Powerful Array[E]★ XOR and Favorite Number[E]Robin Hood Archery[E]Triple Index[M]★ Distinct Values Queries[M]★ Static Range Inversions Query[M]★ Tree and Queries[M]Jeff and Removing Periods[M]★ Chefina and Beautiful Pairs[M]★ Destiny[M]Ann and Books[M]Points on Plane[H]Estimating progress
2.6.7 Rollback Mo and Mo's with DSU¶
- ID:
mos_with_dsu· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/mos_with_dsu
- Templates (1):
- MOs with DSU.cpp
- Resources (3):
- ★ Mo's algorithm and DSU | CF Edu
- ★ A comment by niklasb
- How To Solve This Magical Problem?
- Problems (4):
[E]★ Chef and Graph Queries[M]★ Chef and Problems[M]Zero Query[M]★ Static Range Mode Query
2.6.8 Mo's on Tree¶
- ID:
mos_on_tree· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/mos_on_tree
- Templates (1):
- MOs on tree.cpp
- Resources (1):
- ★ Mo's Algorithm on Trees [Tutorial] by animeshf
- Problems (5):
[E]★ Count on a tree II[E]★ Frank Sinatra[M]Factor Tree[M]So Close Yet So Far[M]Vasya and Little Bear
2.6.9 Sweepline Mo¶
- ID:
sweepline_mo· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/sweepline_mo
- Resources (1):
- ★ [Tutorial] Square root decomposition and applications | box
- Problems (1):
[E]★ XOR and Favorite Number
2.6.10 Mo's with Update / 3D Mo (Offline)¶
- ID:
mos_with_update· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/mos_with_update
- Templates (1):
- MOs with Update.cpp
- Resources (2):
- Mo's Algorithm With Updates by Gaurav Sen
- Mo's Algorithm (with update and without update, now you can understand both) by Fype
- Problems (5):
[E]★ XXXXXXXX[E]★ Distinct Dishting[M]★ Machine Learning[M]Candy Park[H]Primitive Queries
2.6.11 Mo's with Update / 3D Mo (Online)¶
- ID:
mos_online· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/mos_online
- Templates (1):
- MOs Online.cpp
- Resources (1):
- All comments from this blog
- Problems (2):
[E]Problem with Queries[M]★ Machine Learning
2.6.12 4D Mo¶
- ID:
4d_mo· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/4d_mo
- Templates (1):
- 4D MO.cpp
- Problems (2):
[M]★ Strange Queries[M]★ Two Subtrees
2.7 Heavy Light Decomposition (HLD)¶
Subcategory ID: hld · Topics: 1
2.7.1 Heavy Light Decomposition (HLD) ft Subtrees and Path Query¶
- ID:
hld· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/hld
- Templates (1):
- HLD.cpp
- Resources (5):
- ★ Heavy-light decomposition | CP Algorithms
- ★ Hybrid Tutorial #-1: Heavy-Light Decomposition | galen_colin
- ★ Easiest HLD with subtree queries | adamant
- Heavy-Light Decomposition | USACO Guide
- ★ [Idea] Using HLD to reduce memory By maomao90
- Problems (24):
[E]★ Path Queries[E]★ Path Queries II[E]Query on a tree[E]★ Grass Planting[E]Cow Land[E]QTREE3 - Query on a tree again![M]★ Subtrees And Paths[M]★ Vertex Set Path Composite[M]★ Can you answer these queries VII[M]Observing the Tree[M]Pishty and tree[M]Ivan Pesic and His World Tour[M]Black-and-White Tree[M]Milk Visits[M]QTREE4 - Query on a tree IV[M]★ Nim Cheater[M]Best Edge Weight[H]Gangsters of Treeland[H]Max Flow[H]Exercise Route[H]★ Tree Game[H]The Tree[H]Gotham PD[VH]Fibonacci Numbers on Tree
2.8 Centroid Decomposition¶
Subcategory ID: centroid_decomposition · Topics: 2
2.8.1 Centroid Decomposition¶
- ID:
centroid_decomposition· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/centroid_decomposition
- Templates (1):
- Centroid Decomposition.cpp
- Resources (8):
- ★ A Visual Introduction to Centroid Decomposition | Igor Carpanese
- Centroid Decomposition of a Tree | Tanuj Khattar
- ★ Hybrid Tutorial #-2: Centroid Decomposition | galen_colin
- Centroid Decomposition | USACO Guide
- A Simple Introduction to Centroid Decomposition | A Simple Blog
- What is Centroid Decomposition? | Gaurav Sen
- Episode 12 - Divide and Conquer on Trees
- Centroid Decomposition, Auxillary Trees - Kishore Kumar | Inter-College Competitive Programming Camp
- Problems (37):
[E]★ Finding a Centroid[E]★ Ciel the Commander[E]Fixed-Length Paths I[E]★ Fixed-Length Paths II[M]★ Xenia and Tree[M]★ Palindromes in a Tree[M]Mahmoud and a xor trip[M]★ Village (Maximum)[M]Digit Tree[M]Race[M]Sherlock's bet to Moriarty[M]Lampice[M]★ Query on a tree V[M]Prime Distance On Tree[M]★ Close Vertices[M]★ LWDB[M]★ Good Path on a Tree[M]★ Tree Query[M]QTREE4 - Query on a tree IV[M]New Barns[M]BST maintenance[M]Union on Tree[M]Count It[M]Yet Another Tree Problem[M]Black and White Tree[M]★ Awesome Shawarma[M]Another Travelling Salesman Problem[H]Double Tree[H]★ Daylight[H]Factories[H]Bob Equilibrium[H]Synchronization[H]Time Traveller Imaxblue[H]Freezing with Style[H]Red-Black Cobweb[H]Terminus Est[H]Li Hua and Path
2.8.2 Persistent Centroid Decomposition¶
- ID:
persistent_centroid_decomposition· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/persistent_centroid_decomposition
- Templates (1):
- Centroid Decomposition Persistent.cpp
- Resources (1):
- Persistent Centroid Decomposition || Indian Programming Camp 2020 - Advanced Track - Tanuj Khattar
- Problems (1):
[H]★ Can Bash Save the Day?
2.9 Long Path Decomposition¶
Subcategory ID: undefined · Topics: 1
2.9.1 Long Path Decomposition¶
- ID:
long_path_decomposition· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/long_path_decomposition
- Templates (1):
- Long Path Decomposition.cpp
- Problems (1):
[M]★ Spiders Evil Plan
2.10 BST¶
Subcategory ID: binary_search_tree · Topics: 1
2.10.1 Binary Search Tree (BST)¶
- ID:
bst· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/bst
- Templates (2):
- BST.cpp
- BST using STL.cpp
- Resources (4):
- ★ Binary Search Tree(BST) | Programiz
- Binary Search Tree | Geeks For Geeks
- Lecture 5: Binary Search Trees, BST Sort | MIT
- BST Playlist Apna College [Hindi]
- Problems (7):
[E]★ Search in a Binary Search Tree[E]★ Insert into a Binary Search Tree[E]★ Delete Node in a BST[M]★ Number of Ways to Reorder Array to Get Same BST[M]Broken BST[M]Recover Binary Search Tree[H]Sasha and the Wedding Binary Search Tree
2.11 Balanced Binary Search Tree (BBST)¶
Subcategory ID: bbst · Topics: 5
2.11.1 Treap¶
- ID:
treap· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/treap
- Templates (1):
- Treap.cpp
- Resources (5):
- ★ Treap | CP Algorithms
- ★ AlgorithmsThread 9: Treaps | SecondThread
- Treap presentation | Benq
- Treaps : One Tree to Rule ’em all | Tanuj Khattar
- ★ "Merging treaps" -- or how to merge sorted sets in good complexity... By bicsi
- Problems (11):
[E]Order Statistic Set[E]★ Ada and Aphids[E]Ghost Town[E]★ Mass Change Queries[E]Insert[M]★ The Cabins in the Woods[M]★ Hitchhiking in the Baltic States[M]★ Range Reverse Range Sum[H]Points and distances[H]★ Games[VH]Vaporeon
2.11.2 Implicit Treap¶
- ID:
implicit_treap· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/implicit_treap
- Templates (1):
- Implicit Treap.cpp
- Resources (3):
- ★ Implicit Treaps | CP Algorithms
- ★ Implicit Treaps | USACO Guide
- ★ AlgorithmsThread 9: Treaps | SecondThread
- Problems (18):
[E]★ Shandom Ruffle[E]★ Trick or Treap[E]★ Substring Reversals[E]★ Reversals and Sums[E]Yet Another Array Queries Problem[E]All in One[E]★ Cut and Paste[M]★ Maintaining a Sequence[M]Airplane Boarding[M]★ Strings[M]Sneetches and Speeches 3[M]Cup Trick[M]The Grim Treaper[M]Can you answer these queries VI[M]T-Shirts[M]Lucy and Palindromes[M]Permutation and Queries[H]Can you answer these queries VIII
2.11.3 Persistent Treap¶
- ID:
persistent_treap· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/persistent_treap
- Templates (1):
- Treap persistent.cpp
- Resources (1):
- ★ Persistent / Immutable Treaps | Ankit Sultana
- Problems (4):
[E]★ Version Controlled IDE[E]Genetics[M]Persistent List[H]Sequence
2.11.4 Rope¶
- ID:
rope· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/rope
- Templates (1):
- 10355
- Resources (3):
- ★ Implicit cartesian tree in GNU C++ STL | By Perlik
- ★ STL Ropes in C++ | Geeks For Feeks
- ★ Mirrored Rope Trick: Ropes with Reverse Queries | By chromate00
- Problems (3):
[E]★ To the beginning of the formation![E]★ Okret[E]★ Substring Reversals
2.11.5 Splay Tree¶
- ID:
splay_tree· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/splay_tree
- Templates (1):
- SplayTree.cpp
- Resources (4):
- ★ [Tutorial] Splay Tree: One Tree to Rule Them All | by Zhtluo
- ★ Balanced binary search tree rotations WilliamFiset
- Splay Tree Notes | Michel X. Goemans MIT
- Splay Tree Presentation | Stanford
- Problems (3):
[E]★ SuperMemo[E]Ada and List[E]Play with Chain
2.12 Link Cut Tree (LCT)¶
Subcategory ID: lct · Topics: 4
2.12.1 Link Cut Tree (LCT)¶
- ID:
lct· Difficulty: Hard · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/lct
- Templates (1):
- Link Cut Tree.cpp
- Resources (5):
- ★ MIT Lecture 6.851: Advanced Data Structures (Spring'21) | Prof. Erik Demaine
- ★ Dynamic Graphs Scribe Notes | Prof. Erik Demaine
- ★ Maintain subtree information using link/cut trees | ouaan
- ★ A Basic Exploration of Dynamic Trees | Zhiao Huang and Kirito Feng
- Link-cut tree tutorial by ramchandra
- Problems (20):
[E]★ Dynamic Tree Connectivity[E]★ Dynamic Tree Vertex Add Path Sum[M]★ Dynamic LCA[M]★ Dynamic Tree Test (Easy)[M]★ Query on a tree VI[M]Squirrel Cities[M]★ Balanced Tokens[M]Dynamic Tree Vertex Set Path Composite[M]★ Dynamic Tree Vertex Add Subtree Sum[M]Caves and Tunnels[M]Clearing the Snowdrift[H]★ Nauuo and ODT[H]★ Tree or not Tree[H]Train Tracks[H]★ Pastoral Oddities[H]Gangsters of Treeland[H]Sasha and Algorithm of Silence's Sounds[H]大融合[H]★ 共价大爷游长沙[H]Dancing Elephants
2.12.2 Euler Tour Tree (ETT)¶
- ID:
ett· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/ett
- Resources (3):
- ★ On Euler tour trees by ifsmirnov
- ★ A Basic Exploration of Dynamic Trees | Zhiao Huang and Kirito Feng
- Dynamic subtree queries revisited: the Depth First Tour Tree | Paper by Gabriele Farina and Luigi Laura
- Problems (2):
[H]★ Dynamic Tree Subtree Add Subtree Sum[H]★ Mashmokh's Designed Problem
2.12.3 Top Tree / AAA Tree¶
- ID:
top_tree· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/top_tree
- Templates (2):
- top_tree.hpp
- top-tree.hpp
- Resources (3):
- ★ [Tutorial] Fully Dynamic Trees Supporting Path/Subtree Aggregates and Lazy Path/Subtree Updates | smax
- ★ A Basic Exploration of Dynamic Trees | Zhiao Huang and Kirito Feng
- Top-trees and dynamic graph algorithms | Thesis Paper by Jacob Holm and Kristian de Lichtenberg
- Problems (2):
[H]★ Dynamic Tree Subtree Add Subtree Sum[VH]Dynamic Tree Test
2.12.4 Link Cut Cactus¶
- ID:
link_cut_cactus· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/link_cut_cactus
- Templates (1):
- Link-Cut-Cactus
- Resources (1):
- 动态仙人掌 系列题解之四 - link-cut cactus | VFleaKing
- Problems (1):
[M]★ Desert
2.13 Policy Based Data Structures¶
Subcategory ID: policy_based_data_structures · Topics: 2
2.13.1 Ordered Set¶
- ID:
ordered_set· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/ordered_set
- Templates (2):
- Ordered Set.cpp
- PBDS.cpp
- Resources (3):
- ★ C++ STL: Policy based data structures | adamant
- Ordered Set and GNU C++ PBDS | Geeks For Geeks
- Ordered Set | Policy Based Data Structure | Priyansh Agarwal
- Problems (19):
[E]Order Statistic Set[E]★ Inversions[E]Mega Inversions[E]★ Mean of array[E]★ Line up[E]Enemy is weak[E]★ Salary Queries[E]Pashmak and Parmida's problem[E]Petya and Array[E]★ Inversion Count[E]★ Pair of Topics[E]Greetings[E]Colorful Queries[E]Dynamic Collection[M]★ Radio stations[M]Database Query Engine[M]List Removals[M]★ Sliding Window Median[H]Misha and Permutations Summation
2.13.2 GP Hash Table¶
- ID:
gp_hash_table· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/gp_hash_table
- Templates (1):
- GP Hash Table.cpp
- Resources (2):
- ★ C++ STL: Order of magnitude faster hash tables with Policy Based Data Structures By Chilli
- ★ Hashmaps | USACO Guide
- Problems (5):
[E]★ Sum of Two Values[E]★ Sum of Four Values[M]★ Choosing Balls[M]Mr. Kitayuta, the Treasure Hunter[M]Amer and Graphs
2.14 More Tree Data Structures¶
Subcategory ID: more_tree_data_structures · Topics: 6
2.14.1 Wavelet Tree¶
- ID:
wavelet_tree· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/wavelet_tree
- Templates (1):
- Wavelet Tree.cpp
- Resources (3):
- ★ Introduction to New Data Structure: Wavelet Trees | By rachitiitr
- ★ Wavelet Trees for competitive programming | IOI preparation #3 | Errichto
- Wavelet Trees for Competitive Programming | Paper
- Problems (2):
[E]★ K-th Number[E]★ Range Kth Smallest
2.14.2 Cartesian Tree¶
- ID:
cartesian_tree· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/cartesian_tree
- Templates (1):
- Cartesian Tree.cpp
- Resources (3):
- ★ [Tutorial] Cartesian tree and some related problems By tibinyte
- ★ [Tutorial] Cartesian tree on arbitrary graphs By aymanrs
- ★ Solve RMQ (Range Minimum Query) by finding LCA (Lowest Common Ancestor) | CP Algorithms
- Problems (9):
[E]★ Cartesian Tree[E]★ Yet Another Array Counting Problem[M]Fancy Fence[M]Kevin and Math Class[M]Weird Sum[H]★ Comfortably Numb[H]Subsequence[VH]Cartesian Tree[VH]Vaporeon
2.14.3 K-Dimensional Tree (KD Tree)¶
- ID:
kd_tree· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/kd_tree
- Templates (1):
- KD Tree.cpp
- Resources (3):
- ★ kd-Trees | CMSC 420
- A look into K-Dimensional Trees Brandon Wheeless smucs By Brandon Wheeless
- Search and Insertion in K Dimensional tree | Geeks For Geeks
- Problems (2):
[E]★ Remember the Name...[E]★ Closest distance
2.14.4 SQRT Tree¶
- ID:
sqrt_tree· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/sqrt_tree
- Templates (1):
- SQRT Tree.cpp
- Resources (3):
- ★ Sqrt Tree | CP Algorithms
- Sqrt-tree: answering queries in O(1) with O(NloglogN) preprocessing By gepardo
- Sqrt-tree (part 2): modifications in O(sqrtN), lazy propagation | By gepardo
- Problems (3):
[E]★ Product on the segment by modulo[E]★ Count maxima on an interval[E]★ Dynamic Range Minimum Queries
2.14.5 Permutation Tree¶
- ID:
permutation_tree· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/permutation_tree
- Templates (1):
- Permutation Tree.cpp
- Resources (1):
- ★ Tutorial on Permutation Tree | errorgorn
- Problems (7):
[E]★ Common Interval Decomposition Tree[M]★ Good Subsegments[M]★ Intrinsic Interval[M]★ Pudding Monsters[H]★ Army of Me[H]Good Subsequences[H]Beauty of a Permutation
2.14.6 PQ Tree¶
- ID:
pq_tree· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/pq_tree
- Templates (1):
- 123723552
- Resources (1):
- Testing for the consecutive ones property, interval graphs, and graph planarity using PQ-tree algorithms | Paper by Kellogg S. Booth, George S. Lueker
- Problems (3):
[H]★ Organizing a Music Festival[H]Matrix[H]Classroom Scheduling
2.15 Dynamic Connectivity¶
Subcategory ID: dynamic_connectivity · Topics: 2
2.15.1 Dynamic Connectivity Problem (Offline)¶
- ID:
dynamic_connectivity_problem· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/dynamic_connectivity_problem
- Templates (1):
- Dynamic Connectivity Problem.cpp
- Resources (3):
- ★ Deleting from a data structure in O(T(n)logn) | CP Algorithms
- Dynamic Connectivity for Competitive Programming | DSU Rollback on Segment Tree | Vivek
- Dynamic connectivity problem | adamant
- Problems (14):
[E]★ Connect and Disconnect[E]Dynamic Connectivity[E]Addition on Segments[E]★ Extending Set of Points[E]Disconnected Graph[E]★ Dynamic Graph Vertex Add Component Sum[M]★ Joker[M]★ GCD 2010[M]Tree Queries[M]Graph Inclusion[M]★ Modulo 3[M]Bipartite Checking[H]★ A Museum Robbery[H]Festival Signs
2.15.2 Dynamic Connectivity Problem (Online) / HDLT Algorithm¶
- ID:
online_dynamic_connectivity_problem· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/online_dynamic_connectivity_problem
- Resources (2):
- ★ Online Dynamic Connectivity | ko_osaga
- ★ Dynamic Connectivity | MIT CSAIL
- Problems (2):
[E]★ Forced Online Queries Problem[E]★ Dynamic Graph Vertex Add Component Sum
2.16 Monotonic Data Structures¶
Subcategory ID: monotonic_data_structures · Topics: 4
2.16.1 Monotonic Stack: All Nearest Smaller Values and All Subarray Maximum/Minimum¶
- ID:
all_subarray_maximum_minimum· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/all_subarray_maximum_minimum
- Resources (6):
- ★ Introduction to Monotonic Stack – Data Structure and Algorithm Tutorials | Geeks for Geeks
- ★ Monotonic Stack Data Structure Explained | AlgoMonster
- All nearest smaller values | Wiki
- ★ Find the nearest smaller numbers on left side in an array | Geeks for Geeks
- ★ A comment by animeshf regarding sum of all subarray maximums
- Monotonic Increasing & Decreasing Stack
- Problems (16):
[E]★ Nearest Smaller Values[E]★ Next Greater Element I[E]★ Minimum Sum[E]★ Sum of Subarray Minimums[E]Imbalanced Array[E]★ DIFERENCIJA[E]★ Mike and Feet[M]★ Ivan And Mega Queries[M]★ Pudding Monsters[M]Lipshitz Sequence[M]Matrix Maximum Sum[M]★ Skyline Photo[M]★ Max GEQ Sum[H]★ Min Max Sum[H]★ Norma[H]★ Comfortably Numb
2.16.2 Monotonic Queue¶
- ID:
monotonous_queue· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/monotonous_queue
- Templates (1):
- Monotonous Queue.cpp
- Resources (3):
- ★ Monotonic Queue Explained with LeetCode Problems Li Yin Algorithms and Coding Interviews By Li Yin
- ★ Monotonic Queue simulation using Stack data structure
- Introduction to Monotonic Queues | Geeks For Geeks
- Problems (5):
[E]★ Next Greater Element I[E]★ Sliding Window Minimum[E]★ Largest Rectangle in Histogram[M]Strip[H]Pictures with Kittens (hard version)
2.16.3 Monotonic Queue 2D¶
- ID:
monotonous_queue_2d· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/monotonous_queue_2d
- Templates (1):
- 53810?#comment-871637
- Resources (2):
- ★ Monotonic Queue | Ali Ibrahim
- ★ Minima/maxima over all fixed-size arrays (multi-dimensional) | By bicsi
- Problems (6):
[M]Chef and Rectangle Array[M]★ Monitor[M]★ Map[M]Pyramid[M]Stamp Game[M]OpenStreetMap
2.16.4 Monotonic Deque¶
- ID:
monotonic_deque· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/monotonic_deque
- Templates (1):
- 122003
- Resources (1):
- [Tutorial] Minimum Deque By k1r1t0
- Problems (3):
[E]★ Peru[E]Sliding Window Or[H]Bermart Ice Cream
2.17 Miscellaneous¶
Subcategory ID: miscellaneous · Topics: 4
2.17.1 Interval Set¶
- ID:
interval_set· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/interval_set
- Templates (1):
- Interval Set.cpp
- Problems (2):
[E]★ Triangle Count (Hard)[E]★ Daunting Device
2.17.2 Persistent Array¶
- ID:
persistent_array· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/persistent_array
- Templates (1):
- Persistent Array.cpp
- Resources (1):
- Persistent Array | USACO Guide
- Problems (1):
[E]★ Persistent Queue
2.17.3 Persistent Queue¶
- ID:
persistent_queue· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/persistent_queue
- Templates (1):
- Persistent Queue.cpp
- Problems (2):
[E]★ Persistent Queue[E]Persistent Queue ASC 37
2.17.4 Persistent Meldable Heap / Leftist Heap¶
- ID:
persistent_heap· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/persistent_heap
- Templates (1):
- Persistent Meldable Heap.cpp
- Resources (2):
- Leftist tree | Wiki
- Randomized Heap | CP Algorithms
- Problems (1):
[VH]★ K-th Shortest Walk
2.18 Techniques¶
Subcategory ID: techniques · Topics: 7
2.18.1 Venice Technique¶
- ID:
venice_technique· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/venice_technique
- Templates (1):
- Venice Technique.cpp
- Resources (1):
- ★ Venice Technique By cjtoribio
- Problems (5):
[E]★ Querying Multiset[M]Vitya and Strange Lesson[M]Credit Card[M]★ PELODE[H]Village Fair
2.18.2 Offline Queries¶
- ID:
offline_queries· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/offline_queries
- Resources (3):
- What are Online and Offline query-based questions in Competitive Programming | Geeks for Geeks
- What is an offline solution?
- ★ Range Queries with Sweep Line | USACO Guide
- Problems (18):
[E]★ K-query[E]★ Crayon[E]★ Anansi's Cobweb[E]★ Cutting a graph[M]★ Distinct Values Queries[M]Points[M]★ Yaroslav and Divisors[M]Closest Equals[M]Pishty and tree[M]★ Klasika[M]★ Graph and Queries[M]★ Mahmoud and Ehab and yet another xor task[M]★ Nested Ranges Count[H]★ Please, another Queries on Array?[H]★ Modulo Queries[H]Minimum Xor On Segment[H]★ Prime Divisor on Tree Path[H]★ REQ
2.18.3 Static to Dynamic Trick / Log Decomposition¶
- ID:
static_to_dynamic_trick· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/static_to_dynamic_trick
- Templates (1):
- Static to Dynamic Trick.cpp
- Resources (3):
- ★ “Log Decomposition”, a technique to insert random elements into sorted data structures By ismail-but-noob
- ★ Idea 4 of General ideas By adamant
- ★ Blogewoosh #7
- Problems (2):
[M]★ String Set Queries[M]★ Monster Game II
2.18.4 Divide and Conquer on Queries¶
- ID:
divide_and_conquer_on_queries· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/divide_and_conquer_on_queries
- Resources (2):
- ★ Divide & Conquer - SRQ | USACO guide
- ★ [Tutorial] Divide and Conquer Offline Query — A Niche Way to solve Static Range Query By steveonalex
- Problems (13):
[E]★ Static Range Minimum Queries[E]★ Product on the segment by modulo[E]★ Count maxima on an interval[M]★ Secret[M]Toll[M]★ Bob and Continued Fractions[M]Estelle’s Supper Box[M]★ Ivan and Burgers[M]XORSHIFT[H]★ Subsequence Sum Queries[H]★ Non-Decreasing Subsequences[H]★ Greatest Chicken Dish[H]★ Quick Tortoise
2.18.5 CDQ Divide and Conquer¶
- ID:
cdq_divide_and_conquer· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/cdq_divide_and_conquer
- Resources (5):
- ★ A Simple Introduction to CDQ Divide and Conquer | A Simple Blog
- ★ Applications of Divide and Conquer | mzhang2021
- More about Query Problem | HKOI Training Camp
- A comment by Rezwan.Arefin01
- Divide and Conquer for solving Insert-Query Problems Offline | Rezwan's CP Blog
- Problems (4):
[E]★ Another Longest Increasing Subsequence Problem[M]三維偏序問題[M]Intersection of Permutations[H]★ Dynamic Inversion
2.18.6 Queue Undo Trick¶
- ID:
queue_undo_trick· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/queue_undo_trick
- Templates (1):
- Queue Undo Trick.cpp
- Resources (1):
- ★ [Tutorial] Supporting Queue-like Undoing on DS | By Noam527
- Problems (3):
[M]★ Joker[M]Sum[M]★ Fairy
2.18.7 Priority Queue Undo Trick¶
- ID:
priority_queue_undo_trick· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/priority_queue_undo_trick
- Templates (1):
- 81ba61f5e1e508e5f7e1d536dfd19958
- Resources (1):
- ★ [Tutorial] Supporting Priority-Queue-like Undoing on DS By Monogon
- Problems (2):
[M]★ Joker[H]Pastoral Oddities (Copy)
3. Graph Theory¶
Category ID: graph_theory · Subcategories: 21 · Topics: 103
3.1 Graph Traversal¶
Subcategory ID: graph_traversal · Topics: 7
3.1.1 Depth First Search (DFS)¶
- ID:
dfs· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/dfs
- Templates (1):
- DFS.cpp
- Resources (10):
- ★ A Gentle Introduction To Graph Theory | Vaidehi Joshi
- ★ Depth First Search (DFS) Explained: Algorithm, Examples, and Code | Reducible
- ★ Depth First Search Algorithm | Graph Theory WilliamFiset
- ★ Depth First Search (DFS) | Programiz
- Depth First Search or DFS for a Graph | Geeks For Geeks
- ★ Depth first search | CS Academy
- ★ Depth First Search | CP Algorithms
- ★ Check whether a graph is bipartite | CP Algorithms
- Depth First Search | HackerEarth
- ★ Introduction to Tree Algorithms | USACO Guide
- Problems (39):
[E]★ Building Roads[E]★ Subordinates[E]★ Kefa and Park[E]★ Transformation: from A to B[E]★ Ring road[E]★ Send the Fool Further! (easy)[E]★ Fence Planning[E]Mail Stamps[E]★ Counting Rooms[E]Closing the Farm[E]★ The Tag Game[E]★ Building Teams[E]★ A Bug’s Life[E]★ Mahmoud and Ehab and the bipartiteness[E]★ Maze[E]Ice Cave[E]PolandBall and Forest[E]Maximize the Largest Component (Easy Version)[E]Lunar New Year and a Wander[E]Cut 'em all![E]Edgy Trees[E]★ A Wide, Wide Graph[E]Trapped in the Witch's Labyrinth[E]Kirei Attacks the Estate[M]★ Ada and Island[M]★ Sheep[M]★ Road Improvement[M]Garland[M]Labelling Cities[M]★ Leha and another game about graph[M]Ant on the Tree[M]Round Dance[M]★ Graph Without Long Directed Paths[M]★ Cover it![M]★ Beautiful Graph[M]Cyclic Components[H]Dasha and Puzzle[H]Upgrading Tree[H]Centroids
3.1.2 Breadth First Search (BFS)¶
- ID:
bfs· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/bfs
- Templates (1):
- BFS.cpp
- Resources (9):
- ★ Breadth First Search (BFS): Visualized and Explained | Reducible
- Breadth First Search Algorithm | Shortest Path | Graph Theory | WilliamFiset
- ★ Breadth First Search grid shortest path | Graph Theory WilliamFiset
- ★ Breadth-first search | CP Algorithms
- ★ Breadth first search | CS Academy
- ★ Breadth First Search | HackerEarth
- Breadth first search | Programiz
- গ্রাফ থিওরিতে হাতেখড়ি-৪(ব্রেডথ ফার্স্ট সার্চ) | শাফায়েতের ব্লগ
- Multisource BFS | Devansh
- Problems (32):
[E]★ Message Route[E]★ King's Path[E]Minimum Knight moves !!![E]★ Maze[E]★ Labyrinth[E]★ Cycle In Maze[E]Ada and Cycle[E]Find the Treasure[E]A Node Too Far[E]Word Transformation[E]Knight Moves[E]Ice Cave[E]BFS-DFS[E]★ Getting Zero[E]★ Rudolf and the Ball Game[E]Do use hexagon grid[M]★ Police Stations[M]★ Valid BFS?[M]★ Nearest Excluded Points[M]★ Fire Again[M]Shortest Path[M]★ Monsters[M]★ Yet Another Multiple Problem[M]Bombs! NO they are Mines!![M]★ Nearest Opposite Parity[M]★ Graph Girth[M]Swap Game[M]★ Small Multiple[M]Two Buttons[M]Gardener and Tree[H]Egor in the Republic of Dagestan[H]★ Construct a Palindrome
3.1.3 DFS Tree¶
- ID:
dfs_tree· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/dfs_tree
- Resources (1):
- [Tutorial] The DFS tree and its applications: how I found out I really didn't understand bridges By -is-this-fft-
- Problems (15):
[E]★ Bertown roads[E]★ Cactus[E]One-Way Streets[E]★ Strongly Connected Edges[M]Wizard's Tour[M]★ Cactus[M]★ Pairs of Pairs[M]Giving Awards[M]Grand Test[M]Ehab's Last Corollary[M]Two Fairs[M]★ Ehab's Last Theorem[M]★ Tourist Reform[M]★ Fairy[H]★ Simple Cycles Edges
3.1.4 Topological Sorting¶
- ID:
topological_sorting· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/topological_sorting
- Templates (1):
- Topological Sorting.cpp
- Resources (5):
- ★ Topological Sorting | CP Algorithms
- ★ Topological Sort Algorithm | Graph Theory | WilliamFiset
- ★ Topological Sort | Kahn's Algorithm | Graph Theory WilliamFiset
- Topological Sorting | Geeks For Geeks
- ★ [Insight] Number of Topological Orderings of a Directed Tree By Osama_Alkhodairy
- Problems (13):
[E]★ Course Schedule[E]★ Topological Sorting[E]Ordering Tasks[E]★ Max Tree[E]★ Fox And Names[E]Answer the boss![E]★ Find Permutation[E]Chat Screenshots[M]★ Count Ways to Build Rooms in an Ant Colony[M]Build Towers[M]★ Permutation Counting[M]Directing Edges[H]★ Topological Sort
3.1.5 Tree Diameter¶
- ID:
tree_diameter· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/tree_diameter
- Templates (1):
- Tree Diameter.cpp
- Resources (2):
- ★ [Tutorial] Diameter of a tree and its applications By TheScrasse
- AlgorithmsThread 8: Tree Basics
- Problems (19):
[E]★ Tree Diameter[E]★ Tree Distances I[E]★ Eagle and Dogs[E]Circumference of a Tree[E]Dynamic Diameter[E]★ A Wide, Wide Graph[M]★ Anton and Tree[M]★ Removing Coins[M]Tree Tag[M]Civilization[M]★ Three paths on a tree[H]Sonya and Ice Cream[H]★ Tree Compass[H]The Chocolate Spree[H]★ Miracle Tree[H]★ Paint Tree[H]Diameter set[VH]★ Roads and Ramen[VH]Tiles Placement
3.1.6 Euler Tour Technique¶
- ID:
euler_tour_technique· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/euler_tour_technique
- Resources (6):
- ★ Euler Tour Technique | USACO Guide
- ★ AlgorithmsThread 8: Tree Basics
- ★ 18.2 - Subtrees & Paths | CPH
- L01 : Euler Tour Technique or Tree Flattening | Queries On Tree | CodeNCode
- Euler Tour of Tree | Geeks For Geeks
- ★ 12. Euler tour magic, General ideas | adamant
- Problems (11):
[E]★ Subtree Queries[E]Filthy Rich Trees[E]★ Underground Lab[M]Jamie and Tree[M]The Lorax[M]New Year Tree[M]★ Klasika[M]Blood Cousins[M]Water Tree[M]★ Danil and a Part-time Job[M]★ Distance Queries on a Tree
3.1.7 Inverse Graph¶
- ID:
inverse_graph· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/inverse_graph
- Templates (1):
- Inverse Graph.cpp
- Resources (2):
- ★ BFS Trick (Pie for a Pie trick) | By tdpencil
- ★ Traversing the complement graph in linear/near-linear time in multiple ways | By nor
- Problems (11):
[E]★ Connected Components of Complement Graph[E]★ Connected Components?[E]★ 0-1 MST[M]Counter Attack[M]★ A Pie for a Pie[M]Bear and Forgotten Tree 2[M]Complete the MST[M]★ Flight Plans[M]Rust & Murderer[H]★ Topological Sort[H]Nezzar and Hidden Permutations
3.2 Lowest Common Ancestor (LCA)¶
Subcategory ID: lca · Topics: 2
3.2.1 Binary Lifting and LCA¶
- ID:
binary_lifting_and_lca· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/binary_lifting_and_lca
- Templates (1):
- LCA.cpp
- Resources (7):
- ★ Binary Lifting (Kth Ancestor of a Tree Node) | Errichto
- ★ LCA – Lowest Common Ancestor | Errichto
- ★ Lowest Common Ancestor - Binary Lifting | CP Algorithms
- AlgorithmsThread 8: Tree Basics
- ★ Binary Jumping and LCA | USACO Guide
- 18.3 Lowest common ancestor | CPH
- Binary Lifting | aryansh
- Problems (47):
[E]★ Company Queries I[E]★ Company Queries II[E]Lowest Common Ancestor[E]★ Distance Queries[E]★ Jump on Tree[E]★ Distance Query[E]★ Kth Ancestor[E]★ A Secret Mission[E]★ Planets Queries I[E]★ Sloth Naptime[E]★ Cycle Free Flow[E]Min Max Roads[E]★ Tree Queries[E]★ Passable Paths (hard version)[E]Misha, Grisha and Underground[E]★ Query on a tree II[E]★ Lynyrd Skynyrd[E]★ Planets Queries II[M]★ City of Atlantis[M]Blood Cousins[M]★ Longest Good Segment[M]★ Cyclic Array[M]Archaeology[M]Fools and Roads[M]Information Graph[M]★ A and B and Lecture Rooms[M]Duff in the Army[M]★ Minimum spanning tree for each edge[M]Optimal Connectivity[M]★ Lowest Common Ancestor[M]Famil Door and Roads[M]★ Root LCA Queries[M]Drivers Dissatisfaction[M]Rowena Ravenclaw's Diadem[M]Jamie and Tree[M]Ada and Orange Tree[M]★ Omsk Metro (hard version)[M]★ SSttrriinngg in StringString[M]★ Surveillance[M]★ Fun With Functions[M]★ Static Tree[M]Two-Paths[M]Minimal Segment Cover[H]★ Choosing Subtree is Fun[H]Prince's Problem[H]Functional Constraint[H]Graph and Destination
3.2.2 LCA in O(1)¶
- ID:
lca_in_o1· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/lca_in_o1
- Templates (1):
- LCA in O(1).cpp
- Resources (4):
- ★ RANGE MINIMUM QUERY AND LOWEST COMMON ANCESTOR | Topcoder
- ★ Lowest Common Ancestor - $O(\sqrt{N})$ and $O(\log N)$ with $O(N)$ preprocessing | CP Algorithms
- ★ Lowest Common Ancestor - Tarjan's off-line algorithm | CP Algorithms
- Lowest Common Ancestor (LCA) Problem | Eulerian path method | WilliamFiset
3.3 Graph Connectivity¶
Subcategory ID: graph_connectivity · Topics: 9
3.3.1 Strongly Connected Components (SCC)¶
- ID:
scc· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/scc
- Templates (1):
- SCC.cpp
- Resources (6):
- ★ Finding strongly connected components / Building condensation graph | CP Algorithms
- Tarjan's Strongly Connected Component (SCC) Algorithm (UPDATED) | Graph Theory | WilliamFiset
- Strongly Connected Components | HackerEarth
- Strongly Connected Components | USACO Guide
- Strong connectivity and Kosaraju's Algorithm | CPH
- [Bangla] গ্রাফ থিওরিতে হাতেখড়ি ১৪ – স্ট্রংলি কানেক্টেড কম্পোনেন্ট
- Problems (19):
[E]★ Strongly Connected Components[E]★ Flight Routes Check[E]★ Planets and Kingdoms[E]Good Travels[E]Lego[E]Chef and Round Run[E]★ Capital City[E]★ Checkposts[E]Bike paths[M]★ Coin Collector[M]Mr. Kitayuta's Technology[M]True Friends[M]Scheme[M]★ Ada and Panels[M]★ Ralph and Mushrooms[M]Catowice City[M]Valuable Paper[H]★ New Flight Routes[VH]Falling Sand (Hard Version)
3.3.2 Incremental SCC¶
- ID:
incremental_scc· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/incremental_scc
- Resources (2):
- ★ My own algorithm — offline incremental strongly connected components in O(m*log(m)) By Radewoosh
- Incremental Topological Ordering and Strong Component Maintenance | Paper by Bernhard Haeupler, Siddhartha Sen, Robert E. Tarjan
- Problems (3):
[M]★ Strongly Connected Components (Incremental)[H]Link Cut Digraph[VH]Simultaneous Coloring
3.3.3 Articulation Bridges and Bridge Tree¶
- ID:
articulation_bridges_and_bridge_tree· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/articulation_bridges_and_bridge_tree
- Templates (1):
- Articulation Bridges.cpp
- Resources (5):
- ★ Finding bridges in a graph in O(N + M) | CP Algorithms
- ★ Bridge Trees [Tutorial] By aryan12
- Articulation points and bridges (Tarjan's Algorithm) By searleser97
- Articulation Points and Bridges | HackerEarth
- The "Bridge Tree" of a graph | Tanuj Khattar
- Problems (18):
[E]★ Two-Edge-Connected Components[E]★ We Need More Bosses[E]Critical Edges[E]Critical Links[E]Street Directions[E]One-Way Streets[E]★ Pursuit For Artifacts[M]★ Computer Network[M]King Graffs Defense[M]★ Tourist Reform[M]Break Up[M]★ Capital City[M]Delete and Cut Game[M]Code Land[M]★ Rada and the Chamomile Valley[M]Rada and the Chamomile Valley[H]★ Case of Computer Network[H]★ Sherlock and Queries on the Graph
3.3.4 Online Articulation Bridges¶
- ID:
online_articulation_bridges· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/online_articulation_bridges
- Templates (1):
- Online Articulation Bridges.cpp
- Resources (1):
- Finding Bridges Online | CP Algorithms
- Problems (1):
[M]★ GraphAero
3.3.5 Articulation Points and Block Cut Tree¶
- ID:
articulation_points· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/articulation_points
- Templates (2):
- Articulation Points.cpp
- Block Cut Tree.cpp
- Resources (4):
- ★ Finding articulation points in a graph in O(N + M) | CP Algorithms
- Articulation Points and Bridges | HackerEarth
- ★ Biconnected Components | USACO Guide
- ★ Block-cut tree | Wiki
- Problems (14):
[E]★ Network[E]★ Tourist Guide[E]Doves and bombs[E]★ Biconnected Components[M]★ Forbidden Cities[M]★ Submerging Islands[M]Blockade[M]Duathlon[M]Amusing journeys[M]★ Leakage[M]Stopping-off Cities[H]Investment[H]Pipes[H]★ Chef and Sad Pairs
3.3.6 Three Edge Connectivity¶
- ID:
three_edge_connectivity· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/three_edge_connectivity
- Templates (1):
- Three Edge Connectivity.cpp
- Resources (1):
- A simple 3-edge connected component algorithm revisited | Paper by Nima Norouzi, Yung H. Tsin
- Problems (2):
[E]★ Three-Edge-Connected Components[M]★ MaxFlow (II)
3.3.7 Four Edge Connectivity¶
- ID:
four_edge_connectivity· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/four_edge_connectivity
- Resources (1):
- Determining 4-edge-connected components in linear time | Paper by Wojciech Nadara, Mateusz Radecki, Marcin Smulewicz, Marek Sokołowski
3.3.8 Dynamic K-Connectivity¶
- ID:
dynamic_k_connectivity· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/dynamic_k_connectivity
- Resources (1):
- Vertex Sparsification for Edge Connectivity
3.3.9 Ear Decomposition¶
- ID:
ear_decomposition· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/ear_decomposition
- Resources (1):
- ★ Ear decomposition tutorial By ramchandra
- Problems (1):
[H]★ Economic One-way Roads
3.4 Orientation¶
Subcategory ID: orientation · Topics: 2
3.4.1 Strong Orientation¶
- ID:
strong_orientation· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/strong_orientation
- Resources (1):
- ★ Strong Orientation | CP Algorithms
- Problems (2):
[E]★ Strongly Connected Edges[E]Zones
3.4.2 ST-numbering / Bipolar Orientation¶
- ID:
st_numbering· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/st_numbering
- Templates (1):
- ST Numbering.cpp
- Resources (1):
- Bipolar orientation | Wiki
- Problems (3):
[E]★ st-Numbering[E]★ Group Division[M]★ Graph Ordering
3.5 Minimum Spanning Tree (MST)¶
Subcategory ID: minimum_spanning_tree · Topics: 9
3.5.1 Minimum Spanning Tree (Prim's and Kruskal's)¶
- ID:
mst· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/mst
- Templates (2):
- Prim's MST.cpp
- Krushkal's MST.cpp
- Resources (11):
- ★ Minimum spanning tree - Prim's algorithm | CP Algorithms
- ★ Minimum spanning tree - Kruskal's algorithm | CP Algorithms
- ★ Minimum spanning tree - Kruskal with Disjoint Set Union | CP Algorithms
- Second Best Minimum Spanning Tree | CP Algorithms
- Minimum Spanning Tree | HackerEarth
- Prim's Minimum Spanning Tree Algorithm | Graph Theory | WilliamFiset
- Union Find Kruskal's Algorithm | WilliamFiset
- 15.3 Prim’s algorithm | CPH
- 15.1 - Kruskal's | CPH
- ★ Kruskal Visualizer
- Minimum Spanning Trees | USACO Guide
- Problems (41):
[E]★ Spanning Tree[E]★ Road Reparation[E]Dense spanning tree[E]★ Fullmetal Alchemist[E]Chefland and Electricity[E]Flea[E]Igor In the Museum[E]Help the old King[E]Modems[E]Heavy Cycle Edges[E]Design Tutorial: Inverse the Problem[E]Superbull[E]Fenced In[E]★ Better Together![M]Hongcow Builds A Nation[M]★ Path Queries[M]★ MinOr Tree[M]★ Oil business[M]★ Minimum spanning tree for each edge[M]★ Edges in MST[M]★ Envy[M]★ Cost[M]BMW[M]Roads in HackerLand[M]★ Bring Your Own Horse[M]★ GCD and MST[M]★ Choose Two and Eat One[M]★ Spanning Tree Fraction[M]ACM Contest and Blackout[M]I Would Walk 500 Miles[M]Moo Network[M]MST Company[M]Gift[M]★ Counting Graphs[M]★ AND Maximum Spanning Tree[M]★ Turtle and Intersected Segments[M]Road Construction[M]★ Mahmoud and Ehab and the xor-MST[H]Portals[H]DFS Trees[H]Avoid Rainbow Cycles
3.5.2 Steiner Tree Problem¶
- ID:
steiner_tree_problem· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/steiner_tree_problem
- Templates (1):
- Steiner Tree Problem.cpp
- Resources (3):
- ★ Episode 7 - Steiner Trees | Algorithms Live!
- Dreyfus-Wagner DP algorithm | By Arkham_Knight
- Exact Algorithms for Steiner Tree | Ondra Such´y
- Problems (3):
[E]★ Minimum Steiner Tree[M]★ Garden[M]Ticket to Ride
3.5.3 Boruvka's Algorithm¶
- ID:
boruvkas_algorithm· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/boruvkas_algorithm
- Templates (1):
- Boruvka's Algorithm.cpp
- Resources (1):
- ★ [Tutorial] Boruvka's Algorithm By RockyB
- Problems (4):
[M]★ Xor-MST[M]Spanning Tree[H]★ Kuroni and Antihype[H]Air Reform
3.5.4 Minimum Diameter Spanning Tree¶
- ID:
minimum_diameter_spanning_tree· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/minimum_diameter_spanning_tree
- Templates (1):
- Minimum Diameter Spanning Tree.cpp
- Resources (1):
- Explanation of Problem C The GbAaY Kingdom
- Problems (4):
[E]★ Minimum Diameter Spanning Tree[E]★ The GbAaY Kingdom[E]Minimum Diameter Spanning Tree[E]★ BerDonalds
3.5.5 Manhattan MST¶
- ID:
manhattan_mst· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/manhattan_mst
- Templates (1):
- Manhattan MST.cpp
- Resources (1):
- ★ MANHATTAN MINIMUM SPANNING TREE | LINE SWEEP ALGORITHMS | Topcoder
- Problems (4):
[E]★ Manhattan MST[E]★ Dragonstone[E]★ Grid MST[H]★ The Sprawl
3.5.6 Euclidean MST¶
- ID:
euclidean_mst· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/euclidean_mst
- Resources (2):
- [Tutorial] Voronoi Diagram and Delaunay Triangulation in O(n log n) with Fortune's Algorithm | Monogon
- Euclidean minimum spanning tree | Wiki
- Problems (2):
[E]★ Euclidean MST[M]Caravans
3.5.7 Directed MST¶
- ID:
directed_mst· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/directed_mst
- Templates (1):
- Directed MST.cpp
- Resources (1):
- ★ Directed Minimum Spanning Trees | Uri Zwick
- Problems (4):
[E]★ Directed MST[M]FoxTheLinguist[M]★ Teleport[M]★ Stream My Contest
3.5.8 Dynamic MST¶
- ID:
dynamic_mst· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/dynamic_mst
- Templates (2):
- Dynamic MST Offline.cpp
- 53863533
- Resources (4):
- ★ Offline Dynamic MST [Tutorial] By jeroenodb
- Offline Algorithms for Dynamic Minimum Spanning Tree Problems By David Eppstein
- ★ Online Dynamic MST | ivan100sic
- weighted DSU - online dynamic MST without LCT | not_amir
- Problems (4):
[E]★ Dynamic MST[E]★ It's Time to Repair the Roads[E]MST Query[M]collapse
3.5.9 Kirchoffs Theorem ft Number of MSTs¶
- ID:
kirchoffs_theorem_ft_number_of_msts· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/kirchoffs_theorem_ft_number_of_msts
- Templates (1):
- Kirchoffs Theorem.cpp
- Resources (4):
- ★ The Matrix-Tree Theorems
- ★ Kirchhoff's theorem. Finding the number of spanning trees | CP Algorithms
- Kirchhoff’s theorem | Danish Ali
- ★ An intuition and simpler proof for Kirchoff's tree theorem By Everule
- Problems (6):
[E]★ Counting Spanning Trees (Undirected)[E]★ Trux it Up[M]★ Roads in Stars[M]Complement Spanning Trees[M]★ We Love Forest[VH]生成树求和 加强版
3.6 Shortest Paths¶
Subcategory ID: shortest_paths · Topics: 11
3.6.1 Dijkstra's Algorithm¶
- ID:
dijkstras_algorithm· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/dijkstras_algorithm
- Templates (1):
- Dijkstra.cpp
- Resources (7):
- ★ Dijkstra's Shortest Path Algorithm | Graph Theory WilliamFiset
- ★ Dijkstra Algorithm on dense graphs | CP Algorithms
- ★ Dijkstra on sparse graphs | CP Algorithms
- 13.2 Dijkstra’s algorithm | CPH
- ★ Dijkstra Visualizer
- ★ Dijkstra | USACO Guide
- Shortest Path Modelling Tutorial By skavurskaa
- Problems (33):
[E]★ Shortest Routes I[E]★ Shortest Path[E]★ Dijkstra?[E]Fine Dining[E]The Shortest Path[E]Ada and Trip[E]Destination Unknown[E]Rudolf and CodeVid-23[E]★ Bicycles[E]Rendez-vous de Marian et Robin[M]★ Flight Discount[M]★ Flight Routes[M]★ Investigation[M]Robot Turtles[M]★ President and Roads[M]Ivan's Car[M]Shortest Path[M]Jzzhu and Cities[M]Complete The Graph[M]A Journey to Greece[M]★ Team Rocket Rises Again[M]Skipping[M]★ Reducing Delivery Cost[M]Monsters[M]Graph and Graph[H]★ The Classic Problem[H]Crocodile's Underground City[H]★ Robot[H]Find the Path[H]Shortest Paths[H]Dynamic Shortest Path[H]Dirty Arkady's Kitchen[H]Dangerous Bull! Who Wants to Pull?
3.6.2 [Trick] Dijkstra on Segment Tree¶
- ID:
dijkstra_on_segment_tree· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/dijkstra_on_segment_tree
- Templates (1):
- Dijkstra on Segment Tree.cpp
- Resources (3):
- ★ Segment tree for graph problems By ASHWANTH_K
- Check editorial of 786B - Legacy
- [Bangla] Handling shortest path tasks on Dense Graph with Segment Tree | Nafis
- Problems (5):
[E]★ Legacy[M]★ Tickets[M]★ Dense Graph[M]Beautiful Tree[H]★ Babysitting
3.6.3 Floyd Warshall¶
- ID:
floyd_warshall· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/floyd_warshall
- Templates (1):
- Floyd Warshall.cpp
- Resources (4):
- ★ Floyd-Warshall Algorithm | CP Algorithms
- ★ Floyd Warshall All Pairs Shortest Path Algorithm | Graph Theory | Dynamic Programming WilliamFiset
- 13.3 Floyd–Warshall algorithm | CPH
- ★ 4.5 - All-Pairs Shortest Paths | CP2
- Problems (18):
[E]★ Shortest Routes II[E]★ Greg and Graph[E]Roads in Berland[E]Possible Friends[E]106 miles to Chicago[E]★ Travel Company[E]String Problem[E]Arbitrage[E]Frogger[E]★ All Pairs Shortest Path[E]Edge Deletion[E]Weekend[M]Road Construction[M]★ Traveling Graph[M]★ Manic Moving[M]★ Jogging Trails[M]Ingredients[H]Remainder Game
3.6.4 Bellman Ford¶
- ID:
bellman_ford· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/bellman_ford
- Templates (1):
- Bellman Ford.cpp
- Resources (3):
- ★ Bellman-Ford Algorithm | CP Algorithms
- ★ Bellman Ford Algorithm | Shortest path & Negative cycles | Graph Theory WilliamFiset
- Bellman-Ford | USACO Guide
- Problems (12):
[E]★ Single source shortest path, negative weights[E]★ High Score[E]★ Cycle Finding[E]Ford-Bellman[E]MPI Maelstrom[E]The Tourist Guide[E]King[E]★ Travel Company[E]Segments[M]★ Sign of Matrix[M]Extended Traffic[H]★ Specified Range Sums
3.6.5 Shortest Path Faster Algorithm (SPFA)¶
- ID:
spfa· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/spfa
- Templates (1):
- SPFA.cpp
- Resources (3):
- ★ Shortest Path Faster Algorithm (SPFA) | CP Algorithms
- ★ Using the Shortest Path Faster Algorithm to find a negative cycle | KonaeAkira's blog
- Shortest Path Faster Algorithm | Geeks For Geeks
- Problems (3):
[E]★ The Shortest Path[E]The Tourist Guide[M]★ Sign of Matrix
3.6.6 Johnson's Alogrithm¶
- ID:
johnsons_algorithm· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/johnsons_algorithm
- Templates (1):
- Johnson's Algorithm.cpp
- Resources (2):
- Johnson's Algorithm | Brilliant
- [Tutorial] Graph Potentials, Johnson's Algorithm | Monogon
- Problems (3):
[E]★ The Shortest Path[E]★ Johnsons Algorithm[E]Skiing
3.6.7 0/1 BFS¶
- ID:
0_1_bfs· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/0_1_bfs
- Resources (2):
- ★ 0-1 BFS | CP Algorithms
- ★ 0-1 BFS [Tutorial] By himanshujaju
- Problems (15):
[E]★ Labyrinth[E]★ KATHTHI[E]Okabe and City[E]★ Olya and Energy Drinks[E]Chamber of Secrets[E]Tracks in the Snow[E]Jailbreak[E]Ocean Currents[E]Valentines Day[E]★ Wizard in Maze[E]Stronger Takahashi[M]★ Three States[M]Spiral Maximum[M]Nastya and Unexpected Guest[M]Snuke's Subway Trip
3.6.8 Dial's algorithm¶
- ID:
dials_algorithm· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/dials_algorithm
- Templates (1):
- 88408?#comment-790017
- Resources (3):
- ★ [Tutorial] 1-K BFS By Yukuk
- Dial’s Algorithm (Optimized Dijkstra for small range weights) | Geeks For Geeks
- A-2A-BFS (1-2-BFS) By ilyakrasnovv,
3.6.9 Eppsteins Algorithm¶
- ID:
eppsteins_algorithm· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/eppsteins_algorithm
- Templates (1):
- Eppsteins Algorithm.cpp
- Resources (2):
- ★ [Tutorial] k shortest paths and Eppstein's algorithm By meooow
- K-最短路をO((V+E)logV+KlogK)で!?Eppstein's Algorithmのわかりやすい解説!!!【C++実装つき】By hotman78
- Problems (6):
[VH]★ K-th Shortest Walk[VH]Shortest Paths[VH]Subset Sum[VH]Robotic Cow Herd[VH]Shopping Plans[VH]Lights On The Road
3.6.10 Suurballe's Algorithm¶
- ID:
suurballes_algorithm· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/suurballes_algorithm
- Templates (1):
- suurballe.py
- Resources (1):
- ★ Suurballe's algorithm | Wiki
- Problems (3):
[E]★ Admiral[E]Boa viagem, Roim[H]★ Interest
3.6.11 A* Algorithm¶
- ID:
a_star_algorithm· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/a_star_algorithm
- Resources (2):
- A* search algorithm | Wiki
- A* Search Algorithm | Geeks For Geeks
- Problems (4):
[M]Pacman A*[M]Pacman - UCS[M]★ A rã saltadora preguiçosa[H]Poslozi
3.7 Cycles¶
Subcategory ID: cycles · Topics: 5
3.7.1 Cycle Detection¶
- ID:
cycle_detection· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/cycle_detection
- Templates (1):
- Cycle Detection.cpp
- Resources (4):
- ★ Checking a graph for acyclicity and finding a cycle | CP Algorithms
- ★ Finding a negative cycle in the graph | CP Algorithms
- Shortest Cycle in Weighted Graph
- Floyd's Linked List Cycle Finding Algorithm | CP Algorithms
- Problems (11):
[E]★ Round Trip[E]★ Round Trip II[E]★ Cycle Detection (Directed)[E]★ Cycle Finding[E]Alice in Amsterdam, I mean Wonderland[E]★ Cycle Detection (Undirected)[E]Linked List Cycle[M]Cycle in Graph[M]★ Number of Simple Paths[M]★ Graph Girth[M]Medium Demon Problem (easy version)
3.7.2 [Problem] Minimum Weight Cycle For Each Vertex¶
- ID:
minimum_weight_cycle_for_each_vertex· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/minimum_weight_cycle_for_each_vertex
- Templates (1):
- Minimum Weight Cycle For Each Vertex.cpp
- Problems (1):
[E]★ Find the Length
3.7.3 [Problem] Minimum Weight Cycle For Each Edge¶
- ID:
minimum_weight_cycle_for_each_edge· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/minimum_weight_cycle_for_each_edge
- Templates (1):
- Minimum Weight Cycle For Each Edge.cpp
- Problems (1):
[E]★ Ride Sharing Dilemma
3.7.4 Minimum Mean Weight Cycle¶
- ID:
minimum_mean_weight_cycle· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/minimum_mean_weight_cycle
- Templates (1):
- Minimum Mean Weight Cycle.cpp
- Resources (1):
- Karp’s minimum mean (or average) weight cycle algorithm | Geeks For Geeks
- Problems (2):
[E]★ Word Rings[E]Going in Cycle!!
3.7.5 Number of 3 and 4 length Cycles¶
- ID:
number_of_3_and_4_length_cycles· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/number_of_3_and_4_length_cycles
- Templates (1):
- 3 CYCLE and 4 CYCLE.cpp
- Problems (2):
[E]★ Enumerate Triangles[H]★ Connected Subgraphs
3.8 More Tree Stuff¶
Subcategory ID: more_tree_stuff · Topics: 7
3.8.1 Virtual Tree / Auxiliary Tree¶
- ID:
virtual_tree· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/virtual_tree
- Templates (1):
- Virtual Tree.cpp
- Resources (3):
- ★ CP Tutorial: Virtual/Auxiliary Tree | Radoslav Dimitrov
- Editorial of this problem
- Virtual trees method By spike1236
- Problems (10):
[M]★ Kingdom and its Cities[M]★ World Cup City[M]Chaotic V.[M]★ Kitty's Calculations on a Tree[M]★ Yet Another Tree Problem[M]Leaf Color[M]Adjacent Leaves[M]Tree Obsession[M]★ Unique Occurrences[H]Treeland and Viruses
3.8.2 Rerooting Technique¶
- ID:
rerooting_technique· Difficulty: Medium · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/rerooting_technique
- Prerequisites: DP on Trees
- Templates (1):
- all-roots?lang=cpp
- Resources (4):
- ★ DP on Trees - Solving For All Roots | USACO Guide
- ★ Online Query Based Rerooting Technique By DeadlyCritic
- The Ultimate Reroot Template By pajenegod
- Rerooting DP on Trees Tutorial | codemastercpp
- Problems (25):
[E]★ Tree Distances I[E]★ Tree Distances II[E]★ Tree with Maximum Cost[E]Choosing Capital for Treeland[E]★ Maximum White Subtree[M]Two-Paths[M]★ Subtree[M]Tree Painting[M]★ Distance Sums 2[M]City Attractions[M]Distributing Integers[M]Alternating Tree[M]Surrounded Nodes[M]Vertex Deletion[M]★ Expensive Expense[M]★ Road Improvement[M]Casinos and travel[M]★ Tree Inversion[M]★ Tree Path Composite Sum[M]Tree XOR[H]★ Patrol[H]Hard route[H]★ is-this-rerooting[H]★ Tree Sum[VH]Star Trek
3.8.3 Union of Two Paths on a Tree¶
- ID:
path_union· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/path_union
- Templates (1):
- Path Union.cpp
- Problems (2):
[M]★ Max Mex[M]★ MEX Tree
3.8.4 Intersection of Two Paths on a Tree¶
- ID:
path_intersection· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/path_intersection
- Templates (1):
- Path Intersection.cpp
- Problems (1):
[M]★ Path Intersection
3.8.5 [Problem] Number of Paths of Each Length in a Tree¶
- ID:
number_of_paths_of_each_length_in_a_tree· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/number_of_paths_of_each_length_in_a_tree
- Templates (1):
- Number of Paths of Each Length in a Tree.cpp
- Problems (2):
[M]★ Frequency Table of Tree Distance[M]★ Awesome Shawarma
3.8.6 Dynamic Online Tree Diameter¶
- ID:
dynamic_diameter_online· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/dynamic_diameter_online
- Templates (1):
- Dynamic Diameter Online.cpp
- Resources (1):
- ★ Dynamic Diameter | hocky
- Problems (1):
[M]★ Dynamic Diameter
3.8.7 [Problem] Tree Orientation to Maximize Pairs of Reachable Nodes¶
- ID:
tree_orientation_to_maximize_pairs_of_reachable_nodes· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/tree_orientation_to_maximize_pairs_of_reachable_nodes
- Templates (1):
- Tree Orientation.cpp
- Resources (1):
- ★ A comment by Bruteforceman
- Problems (1):
[M]★ Polarization
3.9 Satisfiability¶
Subcategory ID: satisfiability · Topics: 3
3.9.1 2 SAT¶
- ID:
2_sat· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/2_sat
- Templates (1):
- 2 SAT.cpp
- Resources (3):
- ★ 2-SAT | CP Algorithms
- ★ [Tutorial] 2-SAT By arujbansal
- Episode 24 - 2SAT | Algorithms Live!
- Problems (16):
[E]★ 2 Sat[E]★ Giant Pizza[E]Flipping Cards[E]★ Unusual Matrix[E]★ The Door Problem[E]Hackerman[E]Illumination[E]★ ±1[M]★ Coprime Solitaire[M]★ Mex on DAG[M]★ The Light Square[M]Rectangles[H]★ Babysitting[H]Radio Stations[H]★ Exam Requirements[H]Ants
3.9.2 3 SAT¶
- ID:
3_sat· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/3_sat
- Templates (1):
- 3 SAT.cpp
- Resources (2):
- DPLL algorithm
- How does DPLL Algorithm Work? A Brief Explanation of DPLL | Mert Özlütıraş
3.9.3 System Of Difference Constraints¶
- ID:
system_of_difference_constraints· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/system_of_difference_constraints
- Templates (1):
- System Of Difference Constraints.cpp
- Resources (3):
- ★ System of difference constraints
- Solving a system of difference constraints
- Difference constraints and shortest paths
- Problems (5):
[E]★ Playing On A Directed Graph[E]Halum[M]Restore Array[M]01 Sequence[M]Intervals
3.10 Eulerian Path¶
Subcategory ID: eulerian_path · Topics: 1
3.10.1 Eulerian Path and Cycle¶
- ID:
eulerian_path_and_cycle· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/eulerian_path_and_cycle
- Templates (2):
- Euler Path Directed.cpp
- Euler Path Undirected.cpp
- Resources (4):
- ★ Eulerian Tours | USACO Guide
- ★ 19.1 Eulerian paths | CPH
- ★ Eulerian Path/Circuit algorithm (Hierholzer's algorithm) | Graph Theory | WilliamFiset
- ★ Eulerian path | wikiwand
- Problems (18):
[E]★ Eulerian Trail (Directed)[E]★ Eulerian Trail (Undirected)[E]★ Teleporters Path[E]★ Tanya and Password[E]★ Mail Delivery[E]★ One-Way Reform[E]Senior Postmen[E]Play on Words[E]★ Melody[M]★ Traveling Graph[M]★ Matching Substrings[M]★ Johnny and Megan's Necklace[M]★ Turtle and Multiplication[M]Acrobat[M]Weird journey[M]★ Red Blue Graph[M]★ Fair Share[H]Data Center Drama
3.11 Hamiltonian Path¶
Subcategory ID: hamiltonian_path · Topics: 2
3.11.1 Hamiltonian Path and Cycle¶
- ID:
hamiltonian_path_and_cycle· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/hamiltonian_path_and_cycle
- Resources (5):
- ★ 19.2 Hamiltonian paths | CPH
- ★ A little bit of classics: dynamic programming over subsets and paths in graphs By Ripatti
- Hamiltonian Paths and Cycles | Rahul Sethi
- Hamiltonian Cycle | Geeks For Geeks
- Nontrivial Hamiltonian Cycle on 2D grid By Soul_Full_Of_Thunder
- Problems (3):
[E]★ Hamiltonian Flights[E]Fetching Cooking Tools[E]★ Hamiltonian Cycle
3.11.2 Hamiltonian Path Heuristic Algorithm¶
- ID:
hamiltonian_path_heuristic_algorithm· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/hamiltonian_path_heuristic_algorithm
- Templates (1):
- 90513
- Resources (1):
- Heuristic algorithm for Hamiltonian path in directed graphs By Rewinding
- Problems (2):
[M]Hamiltonian Cycle[H]Aerobatics
3.12 Cliques and Independent Sets¶
Subcategory ID: cliques_and_independent_sets · Topics: 2
3.12.1 Maximum Clique¶
- ID:
maximum_clique· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/maximum_clique
- Templates (3):
- Maximum Clique.cpp
- Number of Different Cliques.cpp
- Maximum Clique and Maximum Independent Set Super Fast.cpp
- Resources (3):
- Clique (graph theory) | Wiki
- ★ Bron–Kerbosch algorithm | Wiki
- ★ Editorial of Problem E
- Problems (8):
[E]★ Helping Hiasat[E]Clique Problem[M]★ All Friends[M]★ Clique in the Divisibility Graph[M]Trees of Tranquillity[M]Clique Partition[M]Graph Subset Problem[VH]★ Enumerate Cliques
3.12.2 Maximum Independent Set (MIS)¶
- ID:
maximum_independent_set· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/maximum_independent_set
- Templates (2):
- Maximum Clique.cpp
- Maximum Clique and Maximum Independent Set Super Fast.cpp
- Resources (5):
- Independent set (graph theory) | Wiki
- Maximal independent set | Wiki
- ★ Editorial of Problem E
- Bron–Kerbosch algorithm
- ★ Maximum Independent Set in Trees (Linear Time Algorithm) | Easy Theory
- Problems (5):
[E]★ Maximum Independent Set[E]★ Helping Hiasat[M]★ Maximal Independent Set[M]★ Sensor Network[M]Matching vs Independent Set
3.13 Graph Coloring¶
Subcategory ID: graph_coloring · Topics: 5
3.13.1 Chromatic Number¶
- ID:
chromatic_number· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/chromatic_number
- Templates (1):
- Chromatic Number.cpp
- Resources (1):
- Effective way to compute the chromatic number of a graph By KokiYmgch
- Problems (3):
[E]★ Chromatic Number[E]★ Coloring Graphs[E]Colorful Tree
3.13.2 Welsh-Powell Algorithm¶
- ID:
welsh_powell_algorithm· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/welsh_powell_algorithm
- Resources (2):
- Greedy coloring | Wiki
- ★ Welsh Powell Graph colouring Algorithm | Geeks for Geeks
- Problems (2):
[E]★ Coloring Graphs[VH]Vibrating Paths (Challenge)
3.13.3 Chromatic Polynomial ft Number of DAGs¶
- ID:
chromatic_polynomial_ft_number_of_dags· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/chromatic_polynomial_ft_number_of_dags
- Templates (1):
- Chromatic Polynoimial.cpp
- Resources (3):
- Chromatic polynomial | Wiki
- THE CHROMATIC POLYNOMIAL | CODY FOUTS
- Chromatic Polynomial | Geeks for Geeks
- Problems (2):
[E]★ Chromatic Polynomial[H]★ Amusement Park
3.13.4 Edge Coloring of Simple Graph¶
- ID:
edge_coloring_of_simple_graph· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/edge_coloring_of_simple_graph
- Templates (1):
- Edge Coloring Simple Graph.cpp
- Resources (2):
- Story about edge coloring of graph By ko_osaga
- Vizing's theorem | Wiki
- Problems (2):
[E]★ Algorist Club[M]Game Scheduling
3.13.5 Edge Coloring of Bipartite Graph¶
- ID:
edge_coloring_of_bipartite_graph· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/edge_coloring_of_bipartite_graph
- Templates (2):
- Edge Coloring Bipartite Graph.cpp
- Edge Coloring Bipartite Graph Faster.cpp
- Resources (1):
- ★ Story about edge coloring of graph By ko_osaga,
- Problems (8):
[E]★ Edge coloring of bipartite graph[M]★ Privatization[M]★ Football[M]Choreography[M]Teoreticar[M]Ancient decoration[H]★ Edge Coloring of Bipartite Graph[H]Sorting a Grid
3.14 Graph Counting¶
Subcategory ID: graph_counting · Topics: 5
3.14.1 Counting Labeled Graphs¶
- ID:
counting_labeled_graphs· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/counting_labeled_graphs
- Templates (1):
- Counting Labeled Graphs.cpp
- Resources (1):
- ★ Counting labeled graphs | CP Algorithms
3.14.2 Prufer Code¶
- ID:
prufer_code· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/prufer_code
- Templates (1):
- Prufer Code.cpp
- Resources (2):
- ★ Prüfer code, Cayeley's Formula and the Number of ways to make a graph connected | CP Algorithms
- Counting forests with limited degrees and component sizes By -is-this-fft-
- Problems (7):
[E]★ Prüfer Code[E]Prufer Code[E]Anne's game[E]★ Clues[M]★ Curious Guardians[M]★ The Selection[H]★ Combinatorics Is Fun
3.14.3 [Problem] Number of Arborescences with n Nodes¶
- ID:
number_of_arborescences_with_n_nodes· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/number_of_arborescences_with_n_nodes
- Templates (1):
- Number of Arborescence.cpp
- Resources (1):
- Arborescence (graph theory) | Wiki
3.14.4 Tuttes Theorem ft Arborescences in a Graph¶
- ID:
tuttes_theorem_ft_arborescences_in_a_graph· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/tuttes_theorem_ft_arborescences_in_a_graph
- Templates (1):
- Tuttes Theorem.cpp
- Resources (1):
- The Matrix-Tree Theorems
- Problems (2):
[E]★ Counting Spanning Trees (Directed)[E]★ Counting Arborescence
3.14.5 BEST Theorem¶
- ID:
best_theorem· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/best_theorem
- Resources (2):
- ★ BEST theorem | wiki
- ★ Editorial of Problem G - 16 Integers
- Problems (2):
[E]★ Counting Eulerian Circuits[H]★ 16 Integers
3.15 Dynamic Acyclic Graphs (DAG)¶
Subcategory ID: dynamic_acyclic_graphs · Topics: 2
3.15.1 DAG Reachability¶
- ID:
dag_reachability· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/dag_reachability
- Resources (2):
- [Tutorial] Collection of little techniques By -is-this-fft-
- A Problem About DAG By gkO_o
- Problems (6):
[E]★ Reachable Nodes[E]★ Counting in a DAG[M]★ Upgrading Cities[M]★ Dream and the Multiverse[H]Removal Sequences[H]Balancing Network
3.15.2 Incremental DAG Reachability¶
- ID:
dynamic_dag_reachability· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/dynamic_dag_reachability
- Templates (1):
- DAG Reachability Dynamic.cpp
- Resources (1):
- Amortized efficiency of a path retrieval data structure | Paper by G.F. Italiano
- Problems (1):
[M]★ Ghosts having fun
3.16 Dominators¶
Subcategory ID: dominators · Topics: 1
3.16.1 Dominator Tree¶
- ID:
dominator_tree· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/dominator_tree
- Templates (1):
- Dominator Tree.cpp
- Resources (2):
- ★ Dominator Tree of a Directed Graph | Tanuj Khattar
- Dominator (graph theory) | Wiki
- Problems (6):
[E]★ Dominator Tree[M]★ Team Rocket Rises Again[M]★ Useful Roads[M]Counting on a directed graph[M]★ Increasing Costs[M]Two Paths
3.17 Special Graphs¶
Subcategory ID: special_graphs · Topics: 3
3.17.1 Cactus Graph¶
- ID:
cactus_graph· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/cactus_graph
- Resources (2):
- Cactus graph | Wiki
- [Tutorial] The DFS tree and its applications: how I found out I really didn't understand bridges By -is-this-fft-
- Problems (12):
[E]★ Forest Program[E]★ Cactus[M]★ Cactus[M]Masha and Cactus[H]Cactus Not Enough[H]Cactus Determinant[H]★ Sum of Distances in Cactus[H]Cactus to Tree[H]★ Cactusophobia[VH]New Year Cactus[VH]Happy Cactus[VH]Dead Cacti Society
3.17.2 Tournament Graph¶
- ID:
tournament_graph· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/tournament_graph
- Resources (3):
- ★ Tournament (graph theory) | Wiki
- Hamiltonian Path in Tournament Graph
- Strongly Connected Tournament
- Problems (9):
[E]★ Anya's Simultaneous Exhibition[M]Tournament-graph[M]Rank Fraud[M]★ Cycle[M]Riding in cycles[M]★ Tournament[M]Sum of SCC[H]★ Invertation in Tournament[H]Tournament Construction
3.17.3 Chordal Graph¶
- ID:
chordal_graph· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/chordal_graph
- Templates (1):
- Chordal Graph.cpp
- Resources (2):
- ★ Chordal graph | Wiki
- [Stream] Chordal Graph Omakase By ko_osaga
- Problems (8):
[E]★ Chordal Graph Recognition[M]★ Egg-free DAG[H]City Tour (Large)[H]Road[H]Sister Ports[H]Kid's Nightmare[H]Palindromic Equivalence[VH]Apollonian Network
3.18 Flow and Min Cut¶
Subcategory ID: flow_and_min_cut · Topics: 13
3.18.1 Maximum Flow / Minimum Cut¶
- ID:
max_flow· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/max_flow
- Templates (2):
- Dinics Algorithm.cpp
- PushRelabel.h
- Resources (14):
- ★ Maximum flow - Ford-Fulkerson and Edmonds-Karp | CP Algorithms
- Max Flow Ford Fulkerson | Network Flow | Graph Theory | WilliamFiset
- ★ Edmonds Karp Algorithm | Network Flow | Graph Theory WilliamFiset
- ★ Max-flow min-cut theorem | CP Algorithms
- Maximum flow - Push-relabel algorithm | CP Algorithms
- Maximum flow - Push-relabel method improved | CP Algorithms
- ★ Maximum flow - Dinic's algorithm | CP Algorithms
- ★ Maximum Flow | USACO Guide
- ★ Flows and cuts | CPH
- Dinic's Algorithm | Network Flow | Graph Theory | WilliamFiset
- ★ [Tutorial] My way of understanding Dinitz's ("Dinic's") algorithm By -is-this-fft-
- [Tutorial] Maximum Flow and Minimum Cost Maximum Flow (to prove greedy) By maomao90
- ★ Menger's theorem | Wiki
- Unweighted Bipartite Matching | Network Flow | Graph Theory WilliamFiset
- Problems (23):
[E]★ Download Speed[E]★ Police Chase[E]★ School Dance[E]★ Distinct Routes[E]Fast Maximum Flow[E]★ Fast Maximum Matching[E]★ Matching on Bipartite Graph[E]★ Best Subsequence[M]Array and Operations[M]★ Coin Grid[M]★ Card Game[M]★ The Problem Needs 3D Arrays[M]MobiZone vs VinaGone[M]Delivery Bears[M]Cleaning the Space[M]★ Double Sort II[M]Maximize Mex[M]★ Petya and Graph[H]The Wrath of Kahn[H]★ Bricks[H]Goods transportation[VH]Special Edges[VH]Recover a functional graph
3.18.2 Min Cost Max Flow (MCMF)¶
- ID:
min_cost_max_flow· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/min_cost_max_flow
- Templates (1):
- Min Cost Max Flow.cpp
- Resources (9):
- ★ Minimum-cost flow - Successive shortest path algorithm | CP Algorithms
- ★ [Tutorial] Minimum cost (maximum) flow By -is-this-fft-
- ★ [Tutorial] More about minimum cost flows: potentials and Dinitz By -is-this-fft-
- ★ [Tutorial] Graph Potentials, Johnson's Algorithm, and Min Cost Max Flow | Monogon
- Solving assignment problem using min-cost-flow | CP Algorithms
- Minimum Cost Flow | USACO Guide
- [Tutorial] Maximum Flow and Minimum Cost Maximum Flow (to prove greedy) By maomao90
- MINIMUM COST FLOW PART TWO: ALGORITHMS | Topcoder
- ★ [Tutorial] Simulating Cost Flow By smax
- Problems (26):
[E]★ Parcel Delivery[E]★ Minimum Cost b-flow[E]★ Task Assignment[E]★ Admiral[E]★ Grid Puzzle II[M]★ Four Melodies[M]★ Distinct Routes II[M]★ Red-Blue Graph[M]Dream Team[M]Component Placement[M]★ Anti-Palindromize[M]Space Shuttle Experiments[M]★ Button Lock[M]★ Vasya and Endless Credits[M]★ Petya and Graph[M]Build String[M]April Fools' Problem (medium)[M]★ Catering[M]★ No Cross Matching[M]★ Polynomial K Paths[H]★ Heidi and Library (hard)[H]Programmers and Artists[H]k-Maximum Subsequence Sum[VH]★ Cow and Exercise[VH]One Billion Shades of Grey[VH]April Fools' Problem (hard)
3.18.3 Min Cost Max Flow with Negative Cycles¶
- ID:
min_cost_max_flow_with_negative_cycles· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/min_cost_max_flow_with_negative_cycles
- Templates (1):
- Min Cost Max Flow with Negative Cycles.cpp
- Resources (1):
- A comment by dacin21
- Problems (1):
[M]最小费用最大流
3.18.4 Maximum Closure Problem¶
- ID:
maximum_closure_problem· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/maximum_closure_problem
- Templates (1):
- Maximum Closure Problem.cpp
- Resources (2):
- ★ Closure problem | Wiki
- ★ [Tutorial, Flows] Project Selection Problem By AlexLuchianov
- Problems (7):
[E]★ MUL[M]★ Strange Set[M]Fashion[M]Open-Pit Mining[M]★ Petya and Graph[M]Killable Demon[H]Zoning Restrictions
3.18.5 L-R Flow¶
- ID:
l_r_flow· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/l_r_flow
- Templates (2):
- L R Flow with Dinic.cpp
- L R Flow with MCMF.cpp
- Resources (3):
- ★ Flows with demands | CP Algorithms
- CMSC 451: Max-Flow Extensions | Slides By: Carl Kingsford
- 18 Extensions of Maximum Flow
- Problems (6):
[E]★ Reactor Cooling[M]★ Captain America[M]★ Red-Blue Graph[M]Diverse Singing[H]Incorrect Flow[VH]Showing Off
3.18.6 Gomory-Hu Tree¶
- ID:
gomory_hu_tree· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/gomory_hu_tree
- Templates (1):
- Gomory Hu Tree.cpp
- Resources (1):
- Gomory–Hu tree | Wiki
- Problems (2):
[M]★ Pumping Stations[M]Minimal Cut Matrix
3.18.7 Gomory-Hu Tree of a Planar Graph¶
- ID:
gomory_hu_tree_of_a_planar_graph· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/gomory_hu_tree_of_a_planar_graph
- Templates (1):
- Gomory Hu Tree of Planar Graph.cpp
- Problems (1):
[M]★ All Pair Maximum Flow
3.18.8 Stoer Wagner Algorithm¶
- ID:
stoer_wagner_algorithm· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/stoer_wagner_algorithm
- Templates (1):
- Stoer Wagner Algorithm.cpp
- Resources (1):
- ★ Minimum Cut - Stoer–Wagner algorithm | Coding with Thomas
- Problems (1):
[E]★ Bomb, Divide and Conquer
3.18.9 Chinese Postman Problem¶
- ID:
chinese_postman_problem· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/chinese_postman_problem
- Templates (1):
- Chinese Postman Problem.cpp
- Resources (2):
- Chinese postman problem | Wiki
- ★ Solving the Chinese Postman's Problem | MIT
- Problems (2):
[M]★ Traveling Graph[M]★ Jogging Trails
3.18.10 Uniqueness of Min Cut¶
- ID:
unique_min_cut· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/unique_min_cut
- Templates (1):
- Unique Min Cut.cpp
- Resources (1):
- Determining the uniqueness of a min-cut
- Problems (1):
[E]★ Unique Attack
3.18.11 Maximum Density Subgraph¶
- ID:
maximum_density_subgraph· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/maximum_density_subgraph
- Templates (1):
- Maximum Density Subgraph.cpp
- Resources (1):
- ★ Finding a Maximum Density Subgraph | Goldberg
- Problems (1):
[E]★ Hard Life
3.18.12 Min Cut in a Planar Graph¶
- ID:
min_cut_in_a_planar_graph· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/min_cut_in_a_planar_graph
- Templates (1):
- Min Cut in a Planar Graph.cpp
- Resources (1):
- Min st-Cut of a Planar Graph in O(n log log n) Time | Christian Wulff-Nilsen
- Problems (2):
[E]★ Ada and Hose[E]★ Animal Run
3.18.13 Max Cut in a Planar Graph¶
- ID:
max_cut_in_a_planar_graph· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/max_cut_in_a_planar_graph
- Problems (1):
[H]Planar Max Cut
3.19 Matching¶
Subcategory ID: matching · Topics: 8
3.19.1 Bipartite Matching (HopCroft Karp Algorithm and Kuhn's Algorithm)¶
- ID:
bipartite_matching· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/bipartite_matching
- Templates (2):
- HopCroft Karp Algorithm.cpp
- Kuhns Algorithm.cpp
- Resources (3):
- Hopcroft–Karp Algorithm | Brilliant
- Understanding Hopcroft-Karp Algorithm for Maximum Matching | Punem Nithin
- ★ Kuhn's Algorithm for Maximum Bipartite Matching | CP Algorithms
- Problems (16):
[E]★ School Dance[E]★ Fast Maximum Matching[E]★ Matching on Bipartite Graph[E]Gopher II[E]Work Scheduling[E]Knights in Chessboard (II)[E]Airports[E]Ada and Path[E]★ Best Subsequence[E]Horse Race[M]Maximize Mex[M]Borders[M]Array and Operations[M]Plug It In[H]★ Just Enough Bridges[H]★ Bricks
3.19.2 Hungarian Algorithm / Bipartite Weighted Matching¶
- ID:
hungarian_algorithm· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/hungarian_algorithm
- Templates (1):
- Hungarian Algorithm.cpp
- Resources (3):
- ★ ASSIGNMENT PROBLEM AND HUNGARIAN ALGORITHM | TopCoder
- AlgorithmsThread 0: Hungarian for non Hungarians
- Hungarian Maximum Matching Algorithm | Brilliant
- Problems (6):
[E]★ Task Assignment[E]★ Grid Puzzle II[E]Convincing Customers[M]★ Vasya and Endless Credits[M]Ada and Cities[M]★ No Cross Matching
3.19.3 Blossom Algorithm Unweighted / General Matching / Randomized General Matching¶
- ID:
blossom_algorithm_unweighted· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/blossom_algorithm_unweighted
- Templates (2):
- Blossom Algorithm.cpp
- Randomized Matching Unweighted.cpp
- Resources (4):
- ★ [Tutorial] Blossom Algorithm for General Matching in O(n^3) By Monogon
- Blossom algorithm | Wiki
- Discussion in comments about Randomized Algorithm for General Matching
- ★ Randomized general matching with Tutte matrix By adamant
- Problems (4):
[E]★ Matching on General Graph[E]一般图最大匹配[E]★ Party At School[M]★ A game on a graph
3.19.4 Blossom Algorithm Weighted / General Weighted Matching¶
- ID:
blossom_algorithm_weighted· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/blossom_algorithm_weighted
- Templates (2):
- Blossom Algorithm Weighted.cpp
- Randomized Matching Weighted.cpp
- Problems (2):
[E]★ General Weighted Matching[E]一般图最大权匹配
3.19.5 Stable Marriage Problem¶
- ID:
stable_marriage_problem· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/stable_marriage_problem
- Templates (1):
- Stable Marriage Problem.cpp
- Resources (1):
- Stable marriage problem | Wiki
- Problems (3):
[E]★ Stable Marriage Problem[M]Block Game[H]Restaurants
3.19.6 Konig's Theorem and Maximum Independent Set in Bipartite Graphs¶
- ID:
maximum_independent_set_in_bipartite_graphs· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/maximum_independent_set_in_bipartite_graphs
- Resources (2):
- ★ Maximum Independent Set in Bipartite Graphs | Ali Ibrahim
- Kőnig's theorems through minimum cut in bipartite graphs By adamant
- Problems (4):
[E]★ No Prime Sum[E]Heavy Chain Clusterization[E]★ Best Subsequence[M]Easter Eggs
3.19.7 Halls Theorem¶
- ID:
halls_theorem· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/halls_theorem
- Resources (4):
- ★ Hall's marriage theorem | Wiki
- Hall's theorems through minimum cut in bipartite graphs By adamant
- TCO 2015 Round 1A DIV 1 Problem 1000 Points By awaken
- Discussion about a problem
- Problems (6):
[M]★ Bear and Fair Set[M]Hall's Theorem[M]★ Exhausted?[M]★ Teams[M]★ Ice Skates[H]New Year and Forgotten Tree
3.19.8 Matching using Determinants¶
- ID:
matching_using_determinants· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/matching_using_determinants
- Resources (2):
- ★ A bit more of general ideas By adamant
- ★ Editorial of Divisible Matching
- Problems (2):
[H]Chef and Lost Story[H]★ Divisible Matching
3.20 Partially Ordered Set (POSET)¶
Subcategory ID: poset · Topics: 1
3.20.1 POSET ft Dilworth's and Mirsky's Theorem¶
- ID:
poset_ft_dilworths_and_mirskys_theorem· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/poset_ft_dilworths_and_mirskys_theorem
- Resources (3):
- ★ Partially Ordered Sets By paladin8
- ★ Lecture 14 – Posets: Mirsky’s & Dilworth’s Theorems
- ★ Dilworth Theorem for Competitive Programming | Mirsky's Theorem | Bipartite Matching | Flow | Vivek Gupta
- Problems (10):
[E]★ Cow Jog[E]Nested Dolls[M]★ Clique in the Divisibility Graph[M]Access Levels[M]Polygon Containment[M]★ Select Strings[M]★ Tensor[M]★ Divisibility Relation[H]The Wrath of Kahn[VH]★ Birthday
3.21 Miscellaneous¶
Subcategory ID: miscellaneous · Topics: 5
3.21.1 Functional Graphs¶
- ID:
functional_graphs· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/functional_graphs
- Resources (3):
- ★ Introduction to Functional Graphs | USACO Guide
- 16.3 Successor paths | CPH
- The Tortoise and the Hare (Floyd’s Algorithm) | Tu Vo
- Problems (18):
[E]★ Planets Queries I[E]★ Planets Queries II[E]★ Planets Cycles[E]★ Reachability in Functional Graph[E]Secret Santa[E]Badge[E]The Bovine Shuffle[M]Cooperative Game[M]Visits[M]Luxury River Cruise[M]★ Analysis of Pathes in Functional Graph[M]Medium Demon Problem (easy version)[M]Medium Demon Problem (hard version)[M]Kernel Knights[H]★ Infinite Tree[H]★ Hobson's Trains[H]Vending Machine[H]Mafija
3.21.2 Degree Sequences¶
- ID:
degree_sequences· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/degree_sequences
- Resources (4):
- Erdős–Gallai theorem | Wiki
- Havel–Hakimi algorithm | Wiki
- A simple algorithm for realizing a degree sequence as a connected graph | Szabolcs Horvát
- Gale–Ryser theorem | Wiki
- Problems (6):
[E]★ Degree Set[E]★ Degree Sequence Tree[E]Maximum Diameter Graph[M]New Year and the Acquaintance Estimation[H]Removal Sequences[H]★ Constrained Tree Degree
3.21.3 Tree Isomorphism¶
- ID:
tree_isomorphism· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/tree_isomorphism
- Templates (1):
- Tree Isomorphism.cpp
- Resources (4):
- ★ Tree isomorphism | Slides by Alexander Smal
- ★ Explanation for ‘Tree isomorphism’ talk by Alexander Smal
- [Tutorial] Tree Isomorphism CSES By Olympia
- ★ Hashing root trees By Vladosiya
- Problems (14):
[E]★ Tree Isomorphism I[E]★ Tree Isomorphism II[E]Tree Isomorphism[E]★ Rooted Tree Isomorphism Classification[E]Binary Isomorphism[E]★ Symmetree[E]Vortex[M]A tale of two trees[M]Regular Forestation[M]Tree Automorphisms[M]Two Charts Become One[M]★ Isomorphic Graph[H]★ Timofey and a flat tree[H]★ Generator Tree
3.21.4 Binarizing a Tree¶
- ID:
binarizing_a_tree· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/binarizing_a_tree
- Templates (1):
- Binarizing a Tree.cpp
- Resources (1):
- ★ Editorial of 757G — Can Bash Save the Day?
- Problems (1):
[H]★ Can Bash Save the Day?
3.21.5 Planarity Check¶
- ID:
planarity_check· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/planarity_check
- Resources (2):
- Planarity testing | Wiki
- Session 2A - Fully-dynamic Planarity Testing in Polylogarithmic Time
4. Number Theory¶
Category ID: number_theory · Subcategories: 9 · Topics: 57
4.1 Primes and Divisors¶
Subcategory ID: primes_and_divisors · Topics: 12
4.1.1 Sieve, Prime Factorization and Divisors¶
- ID:
sieve· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/sieve
- Templates (1):
- Sieve.cpp
- Resources (12):
- ★ 21.1 Primes and factors | CPH
- ★ Sieve of Eratosthenes | CP Algorithms
- L02 : Sieve of Eretosthenes | Number Theory | CodeNCode
- Sieve of Eratosthenes | TarifEzaz
- Introduction to Number Theory | David Altizio
- Basic Number Theory-2 | HackerEarth
- ★ Extensions of the Prime Sieve By Hikari9
- ★ Divisibility | USACO Guide
- Least prime factor of numbers till n | Geeks for Geeks
- ★ Prime Factorization using Sieve O(log n) for multiple queries | Geeks for Geeks
- Bitwise Sieve | Geeks for Geeks
- বিটওয়াইজ্ সিভ(Bitwise sieve) | শাফায়েতের ব্লগ
- Problems (44):
[E]★ Count Primes[E]★ Almost Prime[E]★ N-th Prime[E]★ Printing some primes[E]★ Primal Fear[E]A conjecture of Paul Erdős[E]primes triangle (I)[E]★ Medium Factorization[E]★ Integer Factorization (15 digits)[E]★ Counting Divisors[E]★ Divisor Summation[E]★ Common Divisors[E]Sherlock and his girlfriend[E]★ Div Game[E]Four Divisors[E]★ Divisor Summation (Hard)[E]Number of common divisors[E]★ Printing Divisors[E]Interesting Ratio[M]★ T-primes[M]★ N-Factorful[M]★ Namit In Trouble[M]★ Bazinga![M]Binary Sequence of Prime Number[M]A Different Kind of Sorting[M]Noldbach problem[M]Colliders[M]★ Soldier and Number Game[M]Reducing Fractions[M]★ Integral Array[M]Up the Strip[M]Power Products[M]★ Orac and LCM[M]★ Minimum Possible LCM[M]★ Coprime Subsequences[M]Trailing Zeroes (I)[M]Kavi on Pairing Duty[M]An interesting problem[M]Jzzhu and Apples[H]★ The Number of Pairs[H]★ GCD or MIN[H]★ GCD of an Array[H]Chain Reaction[VH]Chef and Sums
4.1.2 Linear Sieve¶
- ID:
linear_sieve· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/linear_sieve
- Templates (1):
- Sieve Linear.cpp
- Resources (2):
- ★ Linear Sieve | CP Algorithms
- [Tutorial] Math note — linear sieve By Nisiyama_Suzune
- Problems (3):
[E]★ Printing some primes[E]The Embarrassed Cryptographer[M]Ingredients that may Harm You
4.1.3 Segmented Sieve¶
- ID:
segmented_sieve· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/segmented_sieve
- Templates (2):
- Segmented Sieve.cpp
- sieve-of-eratosthenes.html#segmented-sieve
- Resources (4):
- ★ Segmented Sieve | CP Algorithms
- Segmented Sieve (Print Primes in a Range) | Geeks For Geeks
- L22 : What is Segmented Sieve and why you should learn it? | Number Theory | CodeNCode
- Segmented sieve of Eratosthenes | kimwalisch
- Problems (6):
[E]★ Prime Generator[E]★ Prime pair connection[E]Prime Intervals[E]Next Prime[E]★ LCM Sequence[M]★ Divisors of Binomial Coefficient
4.1.4 Sieve upto 1e9¶
- ID:
sieve_upto_1e9· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/sieve_upto_1e9
- Templates (1):
- Sieve upto 1e9.cpp
- Problems (2):
[E]★ Printing some primes (Hard)[E]★ Enumerate Primes
4.1.5 Miller-Rabin Primality Test¶
- ID:
miller_rabin_primality_test· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/miller_rabin_primality_test
- Templates (1):
- Miller Rabin.cpp
- Resources (4):
- ★ Primality tests | CP Algorithms
- Miller–Rabin primality test | Wiki
- About Miller Rabbin By Abel51
- A proof of error bound of Miller-Rabin prime test By randop
- Problems (3):
[E]★ Primality Test[E]Prime or Not[E]Next Prime
4.1.6 Pollard Rho¶
- ID:
pollard_rho· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/pollard_rho
- Templates (1):
- Pollard Rho.cpp
- Resources (2):
- ★ Integer factorization | CP Algorithms
- ★ Integer Factorization | Algorithmica
- Problems (5):
[E]★ Factorize[E]★ Integer Factorization (20 digits)[E]★ Divisions[E]★ Story of Totient Function[H]Integer Factorization (29 digits)
4.1.7 Prime Counting Function¶
- ID:
prime_counting_function· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/prime_counting_function
- Templates (1):
- Prime Counting Function.cpp
- Resources (4):
- ★ Counting primes in n^(2/3) By Maksim1744
- Editorial of Problem F
- COMPUTING π(x): THE MEISSEL, LEHMER, LAGARIAS, MILLER, ODLYZKO METHOD | Paper by M. DELEGLISE AND J. RIVAT
- Dirichlet convolution. Part 2: Dirichlet series and prime counting By adamant
- Problems (7):
[E]★ Counting Primes[E]★ Nth Prime[M]★ Four Divisors[M]★ Perfect Points[H]Divisors of factorial (extreme)[H]Amazing Prime Sequence (hard)[H]Breaking Math
4.1.8 [Problem] Counting Numbers Having Exactly K Divisors¶
- ID:
k_divisors· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/k_divisors
- Templates (1):
- K Divisors.cpp
- Resources (1):
- Counting primes in O(n^(2/3)) By Maksim1744
- Problems (1):
[H]★ K-Divisors
4.1.9 [Problem] Smallest Number Having Exactly K Divisors¶
- ID:
smallest_number_having_exactly_k_divisors· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/smallest_number_having_exactly_k_divisors
- Templates (1):
- Smallest Number Having Exactly K Divisors.cpp
- Problems (1):
[M]★ Politeness
4.1.10 Sum of The Number of Divisors in cbrt(n)¶
- ID:
sum_of_the_number_of_divisors_in_cbrt_n· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/sum_of_the_number_of_divisors_in_cbrt_n
- Templates (1):
- Sum of The Number of Divisors in cbrt(n).cpp
4.1.11 Wilson's Theorem¶
- ID:
wilsons_theorem· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/wilsons_theorem
- Resources (2):
- Wilson's theorem | Wiki
- Fool algorithm for finding prime numbers based on long arithmetic By alexvim
- Problems (5):
[E]★ Boring Factorials[E]Boring Factorials (Reloaded)[H]★ Coprime Again[H]Carousel of Combinations[H]Boring Factorials (Extended)
4.1.12 Implicit Prime Factorization¶
- ID:
implicit_prime_factorization· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/implicit_prime_factorization
- Templates (1):
- 159590539
- Resources (1):
- ★ Implicit Prime Factorisation By Everule
- Problems (3):
[M]Sleeping in Class[H]★ Equal LCM Subsets[H]★ Increasing LCMs
4.2 Multiplicative Functions¶
Subcategory ID: multiplicative_functions · Topics: 7
4.2.1 Number of Divisors / Sum of Divisors / Sigma Function¶
- ID:
sigma_function· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/sigma_function
- Resources (3):
- ★ Number of divisors / sum of divisors | CP Algorithms
- Sum Of Number Of Divisors Of Divisors Of A Number By kalimm
- ★ Counting Divisors of a Number in O(n^(1/3)) [tutorial] By himanshujaju
- Problems (14):
[E]★ Counting Divisors[E]Number of common divisors[E]★ Divisor Summation[E]★ Divisor Summation (Hard)[E]★ Common Divisors[E]★ Divisor Analysis[E]★ Aliquot Sum[E]★ Sum of Divisors[E]★ Divisions[M]★ All About Divisors[M]★ Divisors of the Divisors of An Integer[M]★ Divisors[M]Kaosar Loves Divisors[H]★ Smallest Inverse Sum of Divisors
4.2.2 Euler's Totient Function / Phi Function¶
- ID:
eulers_totient_function· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/eulers_totient_function
- Templates (1):
- Phi Function.cpp
- Resources (2):
- ★ Euler's totient function | CP Algorithms
- [Tutorial] Euler's phi function, its properties, and how to compute it By kamilszymczak1
- Problems (34):
[E]★ Euler Totient Function[E]★ Mathematically Hard[E]Best Friend[E]Totient in permutation (easy)[E]Another New Function[E]Irreducable Basic Fractions[E]Farey Sequence Length[E]Relatives[E]Totient Extreme[E]Playing with GCD[E]★ Coprime Integers[E]★ Counting Coprime Pairs[E]★ GCD Extreme[E]Admission to Exam[M]★ Product 1 Modulo N[M]★ Farey Sequence[M]Simple Sum[M]★ LCM Sum[M]★ LCM Extreme[M]★ Farey Sequence[M]★ Golu and Sweetness[M]★ G Force[M]★ Super Pow[M]The Holmes Children[M]★ Madoka and The Best University[M]Relatively Prime Powers[M]★ Eulers Peculiar Dream[M]D. Same GCDs[M]Graph Cost[H]Cowslip Collections[H]Smallest Inverse Euler Totient Function[H]★ Li Hua and Array[H]★ Please, another Queries on Array?[H]★ REQ
4.2.3 Power Tower / Generalized Euler theorem¶
- ID:
power_tower· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/power_tower
- Templates (1):
- Power Tower.cpp
- Resources (2):
- ★ Euler's totient function | CP Algorithms
- Finding an upperbound for the minimum number of iterations on the Euler Totient Function By wakanda-forever
- Problems (6):
[E]★ Simple Calculations[E]★ Exponentiation II[E]A^B^C[M]★ Exponial[M]★ Power Tower[M]★ Venkatesh is bored
4.2.4 Mobius Function and Mobius Inversion¶
- ID:
mobius_function· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/mobius_function
- Templates (1):
- Mobius Function.cpp
- Resources (5):
- ★ Möbius Function | Brilliant
- ★ [Tutorial] Math note — Möbius inversion By Nisiyama_Suzune
- A Dance with Mobius Function | adurysk
- ★ Number Theoretic Functions | Nafis
- A bit more of general ideas By adamant
- Problems (21):
[E]★ GCD Extreme[E]★ Counting Coprime Pairs[E]★ Coprime Integers[E]★ Coprime Triples[M]★ Mike and Foam[M]★ Coprime Subsequences[M]★ Winter is here[M]★ LCMs[M]★ Number of Prime Strings[M]Devu and Birthday Celebration[M]★ Coprime Arrays[M]Simple Sum[M]GCD[M]GCD Product[M]★ Sum Over Subsets[M]★ Sum of gcd of Tuples (Hard)[M]★ List Of Integers[M]★ Square-free integers[M]★ x = a^b[M]★ Joker's GCD Test[H]★ Yet Another Convolution
4.2.5 Dirichlet convolution¶
- ID:
dirichlet_convolution· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/dirichlet_convolution
- Templates (1):
- Dirichlet Convolution.cpp
- Resources (6):
- ★ [Tutorial] Math note — Dirichlet convolution By Nisiyama_Suzune
- ★ 杜教筛 | OI Wiki
- ★ Dirichlet convolution. Part 1: Fast prefix sum computations By adamant
- Summing Multiplicative Functions (Pt. 1) | griff's math blog!
- Dirichlet convolution. Part 2: Dirichlet series and prime counting By adamant
- Prefix Sums of Multiplicative Functions | USACO Guide
- Problems (6):
[E]★ Sum of Totient Function[E]function[E]杜教筛[H]Counting Divisors (square)[H]简单的数学题[H]★ Dirichlet 𝑘 -th root
4.2.6 Min_25 Sieve¶
- ID:
min_25_sieve· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/min_25_sieve
- Templates (1):
- Min_25 Sieve.cpp
- Resources (4):
- ★ On the Min25 sieve and extensions / SPOJ ASSIEVE By box
- ★ Min_25 sieve | OI Wiki
- ★ 新版min25筛(O(n^(2/3)))详解 | dengtesla
- The prefix-sum of multiplicative function: the black algorithm | baihacker
- Problems (7):
[E]★ Sum of Totient Function[E]★ Sum of Multiplicative Function[E]杜教筛[E]★ 简单的函数[E]★ Count Leaves[M]★ Min_25 筛[M]★ A Simple Sieve
4.2.7 Powerful Number Sieve / PN Sieve¶
- ID:
powerful_number_sieve· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/powerful_number_sieve
- Templates (1):
- Powerful Number Sieve.cpp
- Resources (1):
- ★ Powerful Number Sieve | OI Wiki
- Problems (3):
[E]★ 简单的函数[M]★ Jo loves counting[M]★ Min_25 筛
4.3 Euclidean Algorithm¶
Subcategory ID: euclidean_algorithm · Topics: 4
4.3.1 Euclidean Algorithm¶
- ID:
euclidean_algorithm· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/euclidean_algorithm
- Templates (1):
- euclid-algorithm.html#implementation
- Resources (2):
- ★ Euclidean algorithm for computing the greatest common divisor | CP Algorithms
- Euclid's Algorithm By ebanner
- Problems (2):
[E]★ Greatest Common Divisor[M]Blackboard Fibonacci
4.3.2 Extended Euclid¶
- ID:
extended_euclid· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/extended_euclid
- Templates (1):
- Extended Euclid.cpp
- Resources (5):
- ★ Extended Euclidean Algorithm | CP Algorithms
- ★ Extended Euclidean Algorithm | ax + by + cz = gcd(a, b, c)
- ★ Extended Euclidean Algorithm | USACO Guide
- Lamé's Theorem | Cut The Knot
- Modular Multiplicative Inverse | CP Algorithms
- Problems (8):
[E]★ Euclid Problem[E]★ Once Upon A Time[E]Gift Dilemma[E]Marbles[E]Play with Floor and Ceil[E]Mod Inverse[M]★ ConstructOR[M]★ Euclids algorithm revisited
4.3.3 Bezout's Identity¶
- ID:
bezouts_identity· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/bezouts_identity
- Resources (4):
- ★ Bezout's Identity | Brilliant
- Bézout's identity | Wiki
- Bazout's Identity, Codeforces Round #499 (Div. 2) — E By CazadorDivino
- Bézout's identity || Problem D || Codeforces Round 698 || Nezzar and Board || Div 2 | Anmol Gera
- Problems (5):
[E]★ Check If It Is a Good Array[E]Dora and C++[M]★ Border[M]★ Nezzar and Board[M]★ Beauty of the mountains
4.3.4 Chicken McNugget Theorem¶
- ID:
chicken_mcnugget_theorem· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/chicken_mcnugget_theorem
- Resources (2):
- ★ Chicken McNugget Theorem explained[Shortly] By offline-bot
- ★ Chicken McNugget Theorem | AoPS
- Problems (2):
[E]★ I Hate 1111[E]Good ol' Numbers Coloring
4.4 Modular Arithmetic¶
Subcategory ID: modular_arithmetic · Topics: 10
4.4.1 Linear Congruence Equation¶
- ID:
linear_congruence_equation· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/linear_congruence_equation
- Templates (1):
- Linear Congruence Equation.cpp
- Resources (1):
- ★ Linear Congruence Equation | CP Algorithms
4.4.2 Chinese Remainder Theorem (CRT)¶
- ID:
crt· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/crt
- Templates (2):
- CRT.cpp
- Intersection of Arithmetic Progressions.cpp
- Resources (6):
- ★ Chinese Remainder Theorem Part 1 – Coprime Moduli | forthright48
- ★ Chinese Remainder Theorem Part 2 – Non Coprime Moduli | forthright48
- ★ Chinese Remainder Theorem | CP Algorithms
- Garner's algorithm | CP Algorithms
- [Tutorial] Chinese Remainder Theorem By Valiors
- ★ Intersection of two arithmetic progressions
- Problems (14):
[E]★ Chinese Remainder[E]★ Chinese Remainder Theorem (non-relatively prime moduli)[E]★ Monkey Tradition[E]Remainders Game[E]★ nCr[M]★ Cheese and Random Toppings[M]★ Number of Sequences[M]★ Two chandeliers[M]★ The Ultimate Riddle[M]★ Long Sandwich[M]Gears in Action[M]Boring Card Game[H]★ GCD Table[H]Arkanoid
4.4.3 Primitive Root¶
- ID:
primitive_root· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/primitive_root
- Templates (1):
- Primitive Root.cpp
- Resources (2):
- ★ Primitive Root | CP Algorithms
- ★ Primitive root modulo n | I, ME AND MYSELF !!!
- Problems (6):
[E]Cows and Primitive Roots[M]PRIMITIVEROOTS[M]★ Primitive Root[M]★ Product of Minimums[H]★ Product Modulo[H]★ Cool Subsets
4.4.4 Multiplicative Order and Carmichael's Lambda Function¶
- ID:
multiplicative_order· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/multiplicative_order
- Templates (1):
- Multiplicative Order.cpp
- Resources (3):
- Multiplicative order | Wiki
- Carmichael function | Wiki
- JAG summer 2015 Day4 (= OpenCup GP of Japan) D Identity Function By Mi_Sawa
- Problems (5):
[E]★ I Am Good[M]Product transformation[M]Divide and Conquer[H]★ Identity Function[H]★ Discrete Logarithm Problems
4.4.5 Discrete Log / Baby Step Giant Step¶
- ID:
discrete_log· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/discrete_log
- Templates (1):
- Discrete Log.cpp
- Resources (1):
- ★ Discrete Logarithm | CP Algorithms
- Problems (8):
[E]★ Hard Equation[E]Power Modulo Inverted[E]Discrete Logarithm is a Joke[M]★ Inverse of a Function[M]SplittingFoxes3[H]★ Chef and Modular Sequence[H]★ Discrete Logarithm Problems[H]discrete logarithm problem
4.4.6 Discrete Root¶
- ID:
discrete_root· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/discrete_root
- Templates (1):
- Discrete Root.cpp
- Resources (1):
- ★ Discrete Root | CP Algorithms
- Problems (3):
[E]★ Discrete Roots[E]★ Discrete Roots[M]★ Lunar New Year and a Recursive Sequence
4.4.7 Discrete Root in O(P^(1/4))¶
- ID:
discrete_root_in_o_p_1_4· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/discrete_root_in_o_p_1_4
- Templates (1):
- Discrete Root Faster.cpp
- Resources (2):
- ★ Explanation | yukicoder
- Cipolla のアルゴリズム | 37zigen
- Problems (1):
[E]★ Kth Root (Mod)
4.4.8 Discrete Square Root, Tonelli Shanks Algorithm, Cipolla's Algorithm¶
- ID:
tonelli_shanks_algorithm· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/tonelli_shanks_algorithm
- Templates (2):
- Tonelli Shanks Algorithm.cpp
- https://37zigen.com/cipolla-algorithm/
- Resources (4):
- ★ [Prime Mod] Tonelli–Shanks algorithm | Wiki
- [Prime Mod] Cipolla's algorithm | Wiki
- [Prime Mod] Cipolla のアルゴリズム | 37zigen
- ★ [General Solution] Discrete square root modulo By wilcot
- Problems (3):
[E]★ Sqrt Mod[E]二次剩余[M]★ Square Root of LCA Convolution
4.4.9 Number of Distinct Kth Powers Modulo N¶
- ID:
number_of_distinct_kth_powers_modulo_n· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/number_of_distinct_kth_powers_modulo_n
- Templates (1):
- Number of Distinct Kth Powers Modulo n.cpp
- Resources (2):
- ★ Discussion in Math Stack Exchange
- Counting general power residues | Samer Seraj
4.4.10 Number of Solutions to X^2 = 1 mod M¶
- ID:
number_of_solutions_to_x_2_1_mod_m· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/number_of_solutions_to_x_2_1_mod_m
- Templates (1):
- Number of Solutions to x^2 = 1 mod m.cpp
- Resources (2):
- Discussion in Math Stack Exchange 1
- Discussion in Math Stack Exchange 2
- Problems (1):
[E]★ Congruence Problem
4.5 Linear Diophantine Equations¶
Subcategory ID: linear_diophantine_equations · Topics: 5
4.5.1 Linear Diophantine Equation with Two Variables¶
- ID:
linear_diophantine_equation_with_two_variables· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/linear_diophantine_equation_with_two_variables
- Templates (1):
- Linear Diophantine Equation with Two Variables.cpp
- Resources (3):
- ★ Linear Diophantine Equation | CP Algorithms
- ★ Solving Linear Diophantine Equations and Linear Congruential Equations
- Avoid overflow in linear diophantine equation By Jakube
- Problems (11):
[E]★ Solutions to an Equation[E]Crucial Equation[E]The equation[E]★ Ebony and Ivory[E]Get AC in one go[E]The equation[M]★ S = 1[M]Fraction and Sequence[M]★ Infinite Fence[M]Skyscraper Floors[VH]Oppa Funcan Style Remastered
4.5.2 Linear Diophantine Equation with N Variables¶
- ID:
linear_diophantine_equation_with_n_variables· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/linear_diophantine_equation_with_n_variables
- Templates (1):
- Linear Diophantine Equation with N Variables.cpp
- Problems (1):
[E]★ Illegal Towers
4.5.3 Trivariable Linear Diophantine Equation with Nonnegative Solutions¶
- ID:
trivariable_linear_diophantine_equation_with_nonnegative_solutions· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/trivariable_linear_diophantine_equation_with_nonnegative_solutions
- Templates (1):
- Linear Diophantine Equation Three Variables with Nonnegative Solutions.cpp
- Resources (1):
- The Number of Solutions to ax + by + cz = n and its Relation to Quadratic Residues
- Problems (1):
[M]Fraction and Sequence
4.5.4 Multivariable Linear Diophantine Equation with Nonnegative Solutions¶
- ID:
multivariable_linear_diophantine_equation_with_nonnegative_solutions· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/multivariable_linear_diophantine_equation_with_nonnegative_solutions
- Templates (1):
- Linear Diophantine Equation with Nonnegative Solutions.cpp
- Resources (2):
- Congruence Shortest Path Problem By YouKn0wWho
- Comment by sys.
- Problems (2):
[M]★ Building Blocks[M]★ Strange Keyboard
4.5.5 Linear Diophantine With N Unknowns and Two Equations¶
- ID:
linear_diophantine_with_n_unknowns_and_two_equations· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/linear_diophantine_with_n_unknowns_and_two_equations
- Templates (1):
- Linear Diophantine With N Unknowns and Two Equations.cpp
- Problems (1):
[M]★ Interstellar Hunter
4.6 Solutions to Equations¶
Subcategory ID: solutions_to_equations · Topics: 6
4.6.1 Number of Solutions to a Basic Linear Algebraic Equation¶
- ID:
number_of_solutions_to_a_basic_linear_algebraic_equation· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/number_of_solutions_to_a_basic_linear_algebraic_equation
- Templates (1):
- Number of Solutions to a Basic Linear Algebraic Equation.cpp
- Resources (1):
- Number of Solutions to a Linear Algebraic Equation By J-C
- Problems (6):
[E]★ Problem Makes Problem[E]Coins[M]★ Cricket Ranking[M]Biswa the Digital Gutibaj[M]The Top Scorer[M]★ Devu and Flowers
4.6.2 Number of Solutions to a Basic Linear Algebraic Equation using Meet in the Middle¶
- ID:
number_of_solutions_to_a_basic_linear_algebraic_equation_with_variable_upper_bound_constraints· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/number_of_solutions_to_a_basic_linear_algebraic_equation_with_variable_upper_bound_constraints
- Templates (1):
- Number of Solutions to a Basic Linear Algebraic Equation with Variable Upper Bound Constraints.cpp
- Resources (1):
- Editorial of 102114F - Fireflies
- Problems (1):
[M]★ Fireflies
4.6.3 Number of Nonnegative Integer Solutions to ax + by ≤ c¶
- ID:
number_of_nonnegative_integer_solutions_to_ax_by_c· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/number_of_nonnegative_integer_solutions_to_ax_by_c
- Templates (1):
- Number of Nonnegative Integer Solutions to ax+by less than or equal to c.cpp
4.6.4 Number of Integer Solutions to 1/x + 1/y = 1/k¶
- ID:
number_of_integer_solutions_to_1_x_1_y_1_k· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/number_of_integer_solutions_to_1_x_1_y_1_k
- Resources (1):
- Number of positive integral solutions of equation 1/x+1/y=1/n! By Vivek.p
- Problems (1):
[E]★ Equations
4.6.5 Two / Three / Four Squares Theorem¶
- ID:
two_squares_theorem· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/two_squares_theorem
- Resources (8):
- ★ Integer solutions to x² + y² = z By adamant
- Jacobi's Two Square Theorem By NeverSayNever
- Sum of two squares theorem | Wiki
- Fermat's theorem on sums of two squares | Wiki
- Legendre's three-square theorem | Wiki
- Lagrange's four-square theorem | Wiki
- Euler's four-square identity | Wiki
- Brahmagupta–Fibonacci identity | Wiki
- Problems (4):
[E]Pythagorean Pair[M]★ Square Country. Version 2[H]★ 제곱수의 합 (More Huge)[H]제곱수의 합 2 (More Huge)
4.6.6 Pell's Equation¶
- ID:
pells_equation· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/pells_equation
- Templates (1):
- Pells Equation.py
- Resources (3):
- ★ Pell's Equation | Brilliant
- ★ Pell's equation By LieutenantLolicon
- Pythagorean triples and Pell's equations By adamant
- Problems (2):
[M]★ Numeric Center[M]Semi-triangular and also Square
4.7 Floor Sum¶
Subcategory ID: floor_sum · Topics: 3
4.7.1 Sum of Floors¶
- ID:
sum_of_floors· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/sum_of_floors
- Templates (1):
- Sum of Floors.cpp
- Resources (3):
- ★ Editorial of CSES - Sum of Divisors | USACO guide
- Discussion - Sum of floor values
- ★ [Tutorial] Investigating the Harmonic Numbers By Proofy
- Problems (7):
[E]★ Enumerate Quotients[E]★ Sum of Divisors[M]★ Sum of Remainders[M]★ Max/Min[M]★ Sum of Floored Pairs[M]★ Colded LCM[M]Yet Another Sum Problem
4.7.2 Floor Sum and Mod Sum of Arithmetic Progression¶
- ID:
floor_sum_of_arithmetic_progression· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/floor_sum_of_arithmetic_progression
- Templates (1):
- Floor Sum of Arithmetic Progressions.cpp
- Resources (3):
- ★ Floor Sum of Arithmetic Progression and Other Variants | Asif Jawad
- ★ How I understand Floor Sum By prabowo
- 类欧几里德算法 | OI Wiki
- Problems (4):
[E]★ Floor Sum[E]★ Linear Programming?[M]★ Bitwise XOR of Arithmetic Progression[M]★ Ax + By < C
4.7.3 Generalized Floor Sum of Arithmetic Progression¶
- ID:
generalized_floor_sum_of_arithmetic_progression· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/generalized_floor_sum_of_arithmetic_progression
- Templates (1):
- Generalized Floor Sum of Arithmetic Progressions.cpp
- Resources (2):
- ★ Floor Sum of Arithmetic Progression and Other Variants | Asif Jawad
- ★ How I understand Floor Sum By prabowo
- Problems (3):
[E]★ 类欧几里得算法[E]★ 类欧几里得算法[E]WifiPlanet
4.8 Fibonacci Numbers¶
Subcategory ID: fibonacci_numbers · Topics: 4
4.8.1 Fibonacci Numbers¶
- ID:
fibonacci_numbers· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/fibonacci_numbers
- Resources (5):
- ★ Fibonacci Numbers | CP Algorithms
- ★ Fibonacci sequence | Wiki
- Lamé's Theorem | Cut The Knot
- ★ How to check if a given number is Fibonacci number? | Geeks for Geeks
- ★ An amazing way to calculate 10^18-th fibonacci number using 25 lines of code. By kien_coi_1997
- Problems (9):
[E]★ Easy Fibonacci[E]★ Is Fibo[E]Even Fibonacci numbers[E]★ Fibonaccharsis[M]★ Fibonacci Numbers[M]Number Sequence[M]★ Fibonacci Sum[M]★ Euclids algorithm revisited[H]Fibonacci Sequence (Harder)
4.8.2 [Problem] LCM of Fibonacci Numbers¶
- ID:
lcm_of_fibonacci_numbers· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/lcm_of_fibonacci_numbers
- Templates (1):
- LCM of Fibonacci Numbers.cpp
- Resources (1):
- ★ Editorial of Fibonacci LCM by kevinsogo
- Problems (1):
[E]★ Fibonacci LCM
4.8.3 Pisano Period¶
- ID:
pisano_period· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/pisano_period
- Templates (1):
- Pisano Period.cpp
- Resources (2):
- Pisano period | Wiki
- Geeks For Geeks | Fibonacci Number modulo M and Pisano Period
- Problems (4):
[E]★ Modular Fibonacci Period[M]★ Kosuke's Sloth[M]★ Divisible Fibonacci Numbers[H]Fibonacci Number
4.8.4 Phi Field¶
- ID:
phi_field· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/phi_field
- Templates (1):
- Phi Field.cpp
- Problems (6):
[M]★ Fibonacci Numbers[M]★ Fibonacci Fever[M]★ Fibonacci Sum[M]★ Sasha and Array[H]★ Panic! at the Disco[H]Recurrence Power Sum
4.9 Miscellaneous¶
Subcategory ID: miscellaneous · Topics: 6
4.9.1 Pythagorean Triplets¶
- ID:
pythagorean_triplets· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/pythagorean_triplets
- Templates (1):
- Pythagorean Triplets.cpp
- Resources (1):
- Pythagorean triple | Wiki
- Problems (2):
[E]Pythagorean Triples[M]★ Hail Pythagoras
4.9.2 Min of Mod of Arithmetic Progression¶
- ID:
min_of_mod_of_arithmetic_progression· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/min_of_mod_of_arithmetic_progression
- Templates (1):
- 190642
- Resources (1):
- [Library Checker] Min of Mod of Linear | maspy
- Problems (1):
[E]★ Min of Mod of Linear
4.9.3 Factorial Number System¶
- ID:
factoradic_number_system· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/factoradic_number_system
- Templates (1):
- Factoradic Number System.cpp
- Resources (1):
- Factorial number system | Wiki
- Problems (1):
[H]Misha and Permutations Summation
4.9.4 Stern-Brocot Tree and Rational Approximation¶
- ID:
rational_approximation_stern_brocot_tree· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/rational_approximation_stern_brocot_tree
- Templates (1):
- Rational Approximation.cpp
- Resources (3):
- ★ The Stern-Brocot tree and Farey sequences | CP Algorithm
- ★ Some discussions about Finding fraction in a range
- Misunderstood the problem but miraculously got an AC By Sayakiss
- Problems (7):
[E]★ The Stern-Brocot Number System[E]★ Rational Approximation[E]Admission to Exam[M]★ Farey Sequence[M]★ Decimal Form[M]★ A/B < p/q < C/D[M]Nearest Fraction
4.9.5 [Problem] Number of a * x mod p in a Range¶
- ID:
number_of_ax_mod_p_in_a_range· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/number_of_ax_mod_p_in_a_range
- Templates (1):
- Number of ax%p in a Range.cpp
4.9.6 [Problem] Smallest Nonnegative Integer x s.t. l ≤ a * x mod p ≤ r¶
- ID:
smallest_nonnegative_integer_x_s_t_l_ax_mod_p_r· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/smallest_nonnegative_integer_x_s_t_l_ax_mod_p_r
- Templates (1):
- Smallest Nonnegative Integer x s.t. l <= ax % p <= r.cpp
- Resources (2):
- ★ Recovering rational number from its remainder modulo huge integer By adamant
- ★ This is most useful CP problem I create until now By dreamoon_love_AA
- Problems (3):
[M]From Modular to Rational[H]★ Golf Time[H]fraction
5. Combinatorics¶
Category ID: combinatorics · Subcategories: 7 · Topics: 24
5.1 Techniques¶
Subcategory ID: techniques · Topics: 1
5.1.1 Contribution Technique¶
- ID:
contribution_technique· Difficulty: Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/contribution_technique
- Prerequisites: Bit Manipulation, Basic Trees
- Resources (3):
- ★ Algorithms Lecture #1 - Sums and Expected Value Errichto Algorithms
- ★ DSA Series : Contribution Technique | ryuusama
- Contribution technique-I | Ashwanth K
- Problems (18):
[E]★ Two Arrays and Sum of Functions[E]★ Counting Triangles[E]★ Easy Peasy Subset Sum[E]★ SUMMATION[E]Imbalanced Array[E]★ LCM Factorization[E]Jumping Reaction[M]★ Xor Sum 4[M]Convolution XOR SUM[M]★ Sum of XOR Functions[M]★ Math Encoder[M]Intersection and Union[M]★ Score of a Tree[M]★ LuoTianyi and the Floating Islands (Hard Version)[M]★ And Xor Tree[M]Boneca Ambalabu[H]★ Avoid Straight Line[H]★ Yet Another Mex Problem
5.2 Catalan¶
Subcategory ID: catalan · Topics: 2
5.2.1 Catalan Numbers¶
- ID:
catalan_numbers· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/catalan_numbers
- Resources (3):
- ★ Catalan Numbers | CP Algorithms
- 22.2 Catalan numbers | CPH
- ★ Catalan number | Wiki
- Problems (10):
[E]★ Bracket Sequences I[E]Stacking Pancakes[E]Skyline[E]★ Safe Salutations[E]Game of Connections[E]White and Black Balls[M]★ How many trees?[M]★ Counting Perfect BST[M]The Soldier's Dilemma[M]★ Anton and School - 2
5.2.2 Catalan Convolution¶
- ID:
catalan_convolution· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/catalan_convolution
- Resources (1):
- [Tutorial] Catalan Numbers and Catalan Convolution By Dardy
- Problems (2):
[E]White and Black Balls[M]★ Bracket Sequences II
5.3 Inclusion Exclusion¶
Subcategory ID: inclusion_exclusion · Topics: 3
5.3.1 Principle of Inclusion and Exclusion (PIE)¶
- ID:
principle_of_inclusion_and_exclusion· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/principle_of_inclusion_and_exclusion
- Resources (3):
- ★ The Inclusion-Exclusion Principle | CP Algorithms
- 22.3 Inclusion-exclusion | CPH
- ★ [Tutorial] Inclusion-Exclusion Principle By Roundgod
- Problems (28):
[E]★ The Lottery[E]★ Prime Multiples[E]★ Count Good Numbers[E]Cheerleaders[E]Another Game With Numbers[E]EASY MATH[E]FEASTOFPIGS[E]★ Co-prime[E]Typewriter[M]Ugly Number III[M]Sky Code[M]Count Relations[M]★ Square-free integers[M]Almost Prime Numbers Again[M]Find Number Of Pair of Friends[M]Balanced Cow Subsets[M]★ Grid 2[M]★ Count GCD[M]★ Character Encoding[M]★ Tree and Constraints[M]★ x = a^b[M]Natlan Exploring[M]King of Card Games[M]★ Loud Cicada[H]★ K-Inversion Permutations[H]★ Kids Aren't Alright[H]Cowpatibility[H]★ Jzzhu and Numbers
5.3.2 Derangements¶
- ID:
derangements· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/derangements
- Templates (1):
- Derangement.cpp
- Resources (5):
- ★ Derangement | Wiki
- Derangements | USACO Guide
- ★ Derangement Generation of an Array [Tutorial] By lazyneuron
- ★ Rencontres numbers | Wiki
- Help wanted for a interesting problem. By EarthMessenger
- Problems (5):
[E]★ Christmas Party[E]★ Montmort Number[E]★ Almost Identity Permutations[E]★ Derangement[M]Array Shuffling
5.3.3 Inclusion Exclusion on Multiples¶
- ID:
inclusion_and_exclusion_on_multiples· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/inclusion_and_exclusion_on_multiples
- Resources (1):
- ★ [Tutorial] DP in Number Theory By stoyan_malinin
- Problems (20):
[E]★ Counting Coprime Pairs[E]★ Common Divisors[E]Playing with GCD[E]Small GCD[E]★ Coprime Integers[E]★ Coprime Triples[E]★ GCD Extreme[M]★ Coprime Subsequences[M]★ Winter is here[M]★ Number of Prime Strings[M]★ LCMs[M]Devu and Birthday Celebration[M]★ LCM Sum[M]★ LCM Extreme[M]GCD[M]★ Sum of gcd of Tuples (Hard)[M]Yet Another Sum Problem[M]★ Make It One[H]Cowslip Collections[H]★ GCD cost on the tree
5.4 Factorials and Binomial Coefficients (nCr)¶
Subcategory ID: binomial_coefficient · Topics: 8
5.4.1 Lucas Theorem¶
- ID:
lucas_theorem· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/lucas_theorem
- Templates (1):
- Lucas Theorem.cpp
- Resources (3):
- ★ Lucas Theorem – Proof and Applications | forthright48
- Lucas's theorem | Wiki
- ★ Kummer's theorem | Wiki
- Problems (6):
[E]★ Help with selection[E]★ Topper Rama Rao[M]★ The Ultimate Riddle[M]★ Dukkar and Pikka[M]★ Goodbye, Banker Life[M]Cheese and Random Toppings
5.4.2 nCr Modulo Any Mod¶
- ID:
ncr_modulo_any_mod· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/ncr_modulo_any_mod
- Templates (1):
- nCr Modulo Any Mod.cpp
- Resources (4):
- ★ Binomial Coefficients | CP Algorithms
- Best known algos for calculating nCr % M
- ★ Computing n! modulo pᵏ for small p By adamant
- ★ Binomial Modulo Prime Power | prabowo
- Problems (5):
[E]★ nCr[E]★ Binomial Coefficient[M]★ Long Sandwich[M]Strange Game[H]★ Binomial Coefficient
5.4.3 Large Factorials and Binomial Coefficients¶
- ID:
large_factorials· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/large_factorials
- Resources (3):
- ★ [Editorial]Contest Based on SUST Intra University Programming Contest 2019 By YouKn0wWho
- ★ Fastest way to get factorial modulo a prime
- ★ Binomial coefficients of large numbers modulo prime
- Problems (4):
[E]★ Factorial[E]★ Enormous Product[H]Many Factorials[VH]★ Factorial Modulo Prime
5.4.4 Legendre's Formula¶
- ID:
legendres_formula· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/legendres_formula
- Resources (1):
- ★ Finding Power of Factorial Divisor | CP Algorithm
- Problems (2):
[E]★ Trailing Zeroes (III)[E]★ Trailing Zeros
5.4.5 Prefix Sum Queries of Binomial Coefficients¶
- ID:
prefix_sum_queries_of_nci· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/prefix_sum_queries_of_nci
- Templates (1):
- Prefix Sum Queries of nCi.cpp
- Resources (1):
- ★ (Rolling) Range Sum Query of binomial coefficients By arvindf232
- Problems (6):
[E]★ Harvest of Apples[M]★ L Partition[H]★ Cool Subsets[H]Card Game for Three[H]★ The Destruction of the Universe (Hard Version)[H]Multithreading (Hard Version)
5.4.6 Prefix Sum of Binomial Coefficients for a Fixed Large N¶
- ID:
sum_of_nci_for_a_fixed_large_n· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/sum_of_nci_for_a_fixed_large_n
- Templates (1):
- Sum of nCi for a Fixed Large n.cpp
- Resources (1):
- ★ min_25 explanation
5.4.7 Sum of nCr Over a Fixed Congruence Class¶
- ID:
sum_of_ncr_over_a_fixed_congruence_class· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/sum_of_ncr_over_a_fixed_congruence_class
- Templates (1):
- Sum of nCi over a Fixed Congruence Class.cpp
- Problems (2):
[M]★ You[H]★ Simple nCr
5.4.8 [Problem] Sum of nCr(a[i], K) for each K from 1 to N¶
- ID:
sum_of_ncr_a_i_k_for_each_k_from_1_to_n· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/sum_of_ncr_a_i_k_for_each_k_from_1_to_n
- Templates (1):
- Sum of C(a(i), k) for each k from 1 to n.cpp
- Problems (2):
[H]★ Many Easy Problems[H]★ Airplane Cliques
5.5 Stirling Numbers¶
Subcategory ID: stirling_numbers · Topics: 5
5.5.1 Stirling Numbers (Basic)¶
- ID:
stirling_numbers· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/stirling_numbers
- Resources (4):
- Stirling numbers of the second kind | Wiki
- Stirling numbers of the first kind | Wiki
- Recurrence relation for Stirling number of first kind with a minimum value
- Distributing N distinct people in M identical rooms By bluemmb
- Problems (4):
[M]★ Caching Combinatorics[M]Binary Stirling Numbers[VH]Stirling Number of the First Kind (Small p, Large n)[VH]Stirling Number of the Second Kind (Small p, Large n)
5.5.2 Stirling Number of the First Kind for Fixed N¶
- ID:
stirling_number_of_the_first_kind_for_fixed_n· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/stirling_number_of_the_first_kind_for_fixed_n
- Templates (1):
- Stirling Number of the First Kind for Fixed n.cpp
- Resources (2):
- ★ Stirling numbers of the first kind | Wiki
- Stirling numbers with fixed n and k By adamant
- Problems (3):
[E]★ Stirling Number of the First Kind[M]★ Sasha and the Swaps II[H]Bandit Blues
5.5.3 Stirling Number of the First Kind for Fixed K¶
- ID:
stirling_number_of_the_first_kind_for_fixed_k· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/stirling_number_of_the_first_kind_for_fixed_k
- Templates (1):
- Stirling Number of the First Kind for Fixed k.cpp
- Resources (3):
- ★ [Tutorial] Generating Functions in Competitive Programming (Part 1) By zscoder
- Stirling numbers with fixed n and k By adamant
- Expansions for fixed k | Wiki
- Problems (2):
[E]★ Stirling Number of the First Kind (Fixed K)[H]★ Baby Ehab Plays with Permutations
5.5.4 Stirling Number of the Second Kind for Fixed N¶
- ID:
stirling_number_of_the_second_kind_for_fixed_n· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/stirling_number_of_the_second_kind_for_fixed_n
- Templates (1):
- Stirling Number of the Second Kind for Fixed n.cpp
- Resources (1):
- ★ A comment by PrinceOfPersia
- Problems (1):
[E]★ Stirling Number of the Second Kind
5.5.5 Stirling Number of the Second Kind for Fixed K¶
- ID:
stirling_number_of_the_second_kind_for_fixed_k· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/stirling_number_of_the_second_kind_for_fixed_k
- Templates (1):
- Stirling Number of the Second Kind for Fixed k.cpp
- Resources (2):
- Stirling Number of the Second Kind | Wiki
- Stirling numbers with fixed n and k By adamant
- Problems (2):
[E]★ Stirling Number of the Second Kind (Fixed K)[M]★ Partitions
5.6 Partitions¶
Subcategory ID: partitions · Topics: 2
5.6.1 Partitions of an Integer, Partition Function and Pentagonal Number Theorem¶
- ID:
partition_function· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/partition_function
- Templates (1):
- Partition Function.cpp
- Resources (6):
- Partition function (number theory) | Wiki
- ★ Partition Function Intuitive Approach | ABalobanov
- ★ Partitions and pentagonal number theorem By adamant
- Glaisher's theorem
- Pentagonal number theorem | Wiki
- The Pentagonal Number Theorem and All That | Dick Koch
- Problems (5):
[E]★ Partition Function[M]★ Perfect Permutations[M]Decimal Expansion[H]★ Sum of Prod of Min[H]★ Graph Counting
5.6.2 Partitions of a Set / Bell Number¶
- ID:
bell_number· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/bell_number
- Templates (1):
- Bell Number.cpp
- Resources (1):
- Bell number | Wiki
- Problems (2):
[E]★ Bell Number[M]★ Symmetric and Transitive
5.7 Miscellaneous¶
Subcategory ID: miscellaneous · Topics: 3
5.7.1 Burnside's Lemma / Polya Enumeration Theorem¶
- ID:
burnside_lemma· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/burnside_lemma
- Resources (5):
- ★ Burnside's lemma / Pólya enumeration theorem | CP Algorithms
- ★ [Tutorial] Burnside's lemma (with example) By TwoFx
- Burnside Lemma made simple. By Everule
- [Video Tutorial] Burnside Lemma By acraider
- [Tutorial] From Burnside to Polya: A Short Introduction to Group Theory By Zhtluo
- Problems (16):
[E]★ Counting Necklaces[E]★ Necklace[E]★ Counting Grids[E]★ Buildings[E]Count the Necklaces[E]★ Cube Coloring[M]★ Side Transmutations[M]Necklace of Beads[M]★ Lucy and the Flowers[M]Magic Bracelet[M]Sorting Machine[M]★ Colorful Grids[M]Dodecahedron[H]★ Unique Strings[H]Cube[H]Number of Cubes
5.7.2 Bertrand's Ballot Theorem¶
- ID:
bertrands_ballot_theorem· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/bertrands_ballot_theorem
- Resources (1):
- Bertrand's ballot theorem | Wiki
- Problems (3):
[E]★ Yanu in Movie theatre[M]★ Winning at Sports[H]Vaibhav and Ministers
5.7.3 Young Tableaus and the Hook Length Formula¶
- ID:
young_tableaus· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/young_tableaus
- Resources (1):
- ★ Young Tableaus and the Hook Length Formula By mango_lassi
- Problems (3):
[H]★ Disjoint LIS[H]LIS Counting[H]L(I+D)S
6. Math¶
Category ID: math · Subcategories: 10 · Topics: 79
6.1 Convolution¶
Subcategory ID: convolution · Topics: 7
6.1.1 Fast Fourier Transform (FFT)¶
- ID:
fft· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/fft
- Templates (1):
- FFT.cpp
- Resources (11):
- ★ Multiplying polynomials | Fast Fourier Transform (FFT)
- ★ Fast Fourier transform | CP Algorithms
- ★ Tutorial on FFT/NTT — The tough made simple. ( Part 1 ) By sidhant
- ★ [Tutorial] FFT By -is-this-fft-,
- FFT | peltorator
- Fast Fourier Transform and Polynomials Moscow International Workshop ACM ICPC 2017 | Oleksandr Kulkov
- ★ The Remarkable Story Behind The Most Important Algorithm Of All Time | Veritasium
- ★ But what is the Fourier Transform? A visual introduction | 3Blue1Brown
- ★ The Fast Fourier Transform (FFT): Most Ingenious Algorithm Ever? | Reducible
- FFT | FFT with mod | NTT | Arabic tutorial for Competitive Programming
- Applications on FFT | Arabic tutorial for Competitive Programming
- Problems (34):
[E]★ Apples and Bananas[E]★ Polynomial Multiplication[E]★ A+B Problem[E]★ Thief in a Shop[E]★ Ada and Nucleobase[E]★ K-Inversions[E]★ Maximum Self-Matching[E]★ Signal Processing[E]Not Divisible[E]★ Very Fast Multiplication[E]Fine Triplets[E]One Bit Positions[E]Nefertiti[E]Jinin[E]Piscine today[M]★ Triple Sums[M]★ Nikita and Order Statistics[M]Yet Another String Matching Problem[M]Lightsabers (hard)[M]Running Competition[M]★ Lazy Hash Table[M]★ Fuzzy Search[M]Rusty String[M]★ Frequency Table of Tree Distance[M]★ Awesome Shawarma[M]Swimmers in the Pool[M]Substring Search[M]Bit Substrings[M]Gateways of Beisan[M]Convolution (Mod 2^64)[H]★ Product Modulo[H]Design Tutorial: Increase the Constraints[H]★ Tile Cutting[VH]Epic Convolution
6.1.2 Number Theoretic Transform (NTT)¶
- ID:
ntt· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/ntt
- Templates (2):
- NTT.cpp
- NTT With Any Prime MOD.cpp
- Resources (4):
- ★ Number theoretic transform | CP Algorithms
- Tutorial on FFT/NTT — The tough made simple. ( Part 2 ) By sidhant
- Fast convolution for 64-bit integers By quasisphere
- NTT with modular arithmetic reductions | performance comparasion with FFT
- Problems (25):
[E]★ Convolution[E]★ Convolution (Mod 1,000,000,007)[E]★ Lucky Tickets[E]★ Product of Polynomial Sequence[E]★ Play the Lottery[E]Jinin[E]K-rep Array[M]★ XOR Sums[M]★ A Cumulative Sum Problem[M]★ Product Tuples[M]★ Divisor Set[M]★ Linear Diophantine Equation[M]Lucas Theorem[M]★ Tree Coloring[M]★ Add By Permutation[M]★ Binomial Fever[M]Red-White Fence[M]Symmetric Swap[M]K for More, K for Less[H]★ Constrained Tree Degree[H]★ Power Sum[H]Permutations[H]★ Transforming Sequence[H]★ PolandBall and Many Other Balls[H]Chef and Interval Painting
6.1.3 2D FFT / NTT¶
- ID:
2d_fft_ntt· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/2d_fft_ntt
- Templates (1):
- NTT 2D.cpp
- Problems (4):
[E]★ Dasha and cyclic table[E]★ Buying Land[M]★ Matchings[M]★ Mosaic Browsing
6.1.4 Online FFT / NTT¶
- ID:
online_ntt· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/online_ntt
- Templates (2):
- NTT Online (D&C).cpp
- NTT Online.cpp
- Resources (3):
- ★ CDQ convolution (online FFT) generalization with Newton method By adamant,
- ★ Online FFT Slides | Tanuj Khattar
- ★ Relaxed Convolution | Atcoder Editorial
- Problems (8):
[M]★ Colored Forests[M]Jetpack[M]Expected Number of Customers[M]★ Graph Coloring (hard version)[M]★ Typical Convolution Problem[H]Kyoya and Train[H]Bin[H]Stroll
6.1.5 Fast Walsh Hadamard Transform (FWHT) and its Variations¶
- ID:
fwht· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/fwht
- Templates (3):
- FWHT.cpp
- FWHT in Ternary Base.cpp
- FWHT in Any Base.cpp
- Resources (10):
- ★ Fast Walsh-Hadamard Transform in Competitive Programming | Chengyuan Ma's Blog
- ★ Fast Walsh Hadamard Transforms and it's inner workings By upobir
- Fast Fourier Transform and variations of it | by atatomir
- 15. xor-, and-, or-convolutions | General ideas By adamant
- ★ logical_convolutions.pdf | ivanzuki
- ★ OR Convolution for Common People By ko_osaga
- ★ Intuitive Meaning of All Convolutions | Comment by pajenegod
- ★ Generalized FWHT: How I realized I did not understand FWHT By errorgorn
- Ternary FWHT
- FWHT in Any Base
- Problems (18):
[E]★ Maxor[E]★ And Closure[E]★ XOR Path[E]★ Random Nim Generator[M]Tokens on a grid[M]★ Xor Spanning Tree[M]★ Sum the Fibonacci[M]Flip Row or Col[H]Games[H]★ United in Stormwind[H]★ Deck-Building Game[H]黎明前的巧克力[H]★ Winning Ways[H]★ Chef and Horcrux[H]★ Nim Counting[H]18. Security Camera[VH]★ Beautiful XOR Problem[VH]★ Sum of (XOR^K or 0)
6.1.6 GCD Convolution¶
- ID:
gcd_convolution· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/gcd_convolution
- Templates (1):
- 153821
- Resources (2):
- ★ [Tutorial] GCD Convolution By szaranczuk
- ★ [Tutorial] Zeta, Mobius Transform to AND, OR, GCD Convolution By jinhan814
- Problems (3):
[E]★ Gcd Convolution[M]★ Exclusive Multiplication[M]★ Yet Another GCD Problem
6.1.7 LCM Convolution¶
- ID:
lcm_convolution· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/lcm_convolution
- Templates (1):
- 153819
- Resources (2):
- [Tutorial] GCD Convolution By szaranczuk
- ★ [Tutorial] Zeta, Mobius Transform to AND, OR, GCD Convolution By jinhan814
- Problems (1):
[E]★ Lcm Convolution
6.2 Polynomial¶
Subcategory ID: polynomial · Topics: 22
6.2.1 Generating Functions¶
- ID:
generating_functions· Difficulty: Hard · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/generating_functions
- Templates (1):
- Polynomial.cpp
- Resources (7):
- ★ [Tutorial] Generating Functions in Competitive Programming (Part 1) By zscoder
- ★ Operations on polynomials and series | CP Algorithms
- ★ [Tutorial] Generating Functions in Competitive Programming (Part 2) By zscoder
- A problem collection of ODE and differential technique By jqdai0815
- Exponential formula | Wiki
- ★ Useful substitutions with generating functions By adamant
- Solution to ARC154F Dice Game -- Generating functions and polynomials By Bring
- Problems (20):
[M]Yet Another Number Sequence[H]★ K-Inversion Permutations[H]★ Many Easy Problems[H]★ Ppeerrffeecctt Ssqquuaarreess[H]★ Weird Product[H]★ Transforming Sequence[H]★ Chef and Rainbow Road[H]★ Dice Game[H]★ The Child and Binary Tree[H]链式反应[H]★ Q 的序列[H]★ Simple nCr[H]O Andar do Trêbado[VH]★ Sum of Fibonacci Sequence[VH]Quasi-Polynomial Sum[VH]Slime and Sequences (Hard Version)[VH]★ Simple Counting[VH]★ Rhyme[VH]通用测评号[VH]珍珠
6.2.2 Polynomial Inverse¶
- ID:
polynomial_inverse· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/polynomial_inverse
- Templates (1):
- Polynomial.cpp
- Resources (1):
- Inverse series | CP Algorithms
- Problems (4):
[E]★ Inv of Formal Power Series[H]★ The Child and Binary Tree[H]Chef and the Combination Lock[H]Inv of Formal Power Series (Sparse)
6.2.3 Polynomial Exp¶
- ID:
polynomial_exp· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/polynomial_exp
- Templates (1):
- Polynomial.cpp
- Resources (1):
- Exponent | CP Algorithm
- Problems (4):
[E]★ Exp of Formal Power Series[M]★ Perfect Partitions[H]★ K-Inversion Permutations[H]Exp of Formal Power Series (Sparse)
6.2.4 Polynomial Log¶
- ID:
polynomial_log· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/polynomial_log
- Templates (1):
- Polynomial.cpp
- Resources (1):
- Logarithm | CP Algorithm
- Problems (4):
[E]★ Log of Formal Power Series[M]★ Perfect Partitions[H]★ K-Inversion Permutations[H]Log of Formal Power Series (Sparse)
6.2.5 Polynomial Pow¶
- ID:
polynomial_pow· Difficulty: Hard · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/polynomial_pow
- Templates (1):
- Polynomial.cpp
- Resources (1):
- k-th power | CP Algorithms
- Problems (3):
[E]★ Pow of Formal Power Series[E]★ Lucky Tickets[M]Pow of Formal Power Series (Sparse
6.2.6 Polynomial Sqrt¶
- ID:
polynomial_sqrt· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/polynomial_sqrt
- Templates (1):
- Polynomial.cpp
- Problems (4):
[E]★ Sqrt of Formal Power Series[M]★ Perfect Strings[H]★ The Child and Binary Tree[H]Sqrt of Formal Power Series (Sparse)
6.2.7 Polynomial Composition¶
- ID:
polynomial_composition· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/polynomial_composition
- Templates (1):
- Polynomial.cpp
- Resources (1):
- Fast polynomial composition By adamant
- Problems (2):
[E]★ Composition of Formal Power Series[M]Compositional Inverse of Formal Power Series
6.2.8 Multipoint Evaluation¶
- ID:
multipoint_evaluation· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/multipoint_evaluation
- Templates (1):
- Polynomial.cpp
- Resources (2):
- Multi-point Evaluation | CP Algorithms
- Evaluation and interpolation on geometric progression By adamant
- Problems (6):
[E]★ Multipoint Evaluation[E]★ Evaluate the polynomial[M]Chef and Equations[H]★ Chef and Rainbow Road[H]★ Weird Product[H]Multipoint Evaluation (Geometric Sequence)
6.2.9 Chirp Z Transform¶
- ID:
chirp_z_transform· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/chirp_z_transform
- Templates (1):
- Polynomial.cpp
- Resources (2):
- Chirp-z Transform | CP Algorithms
- [Tutorial] Generalized Chirp Z-Transform By box
- Problems (4):
[E]★ Chirp Z-Transform (mod 998244353)[E]★ Chirp Z-Transform (mod 10^9 + 7)[H]Cyclic Cipher[H]Heidi Learns Hashing (Hard)
6.2.10 Polynomial Interpolation¶
- ID:
polynomial_interpolation· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/polynomial_interpolation
- Templates (1):
- Polynomial.cpp
- Resources (3):
- Interpolation | CP Algorithms
- Evaluation and interpolation on geometric progression By adamant
- [TUTORIAL] Basic Lagrange Interpolation pt. 2 By grhkm
- Problems (3):
[E]★ Polynomial Interpolation[H]Polynomial Interpolation (Geometric Sequence)[H]★ Weird Sum
6.2.11 Polynomial Shift¶
- ID:
polynomial_shift· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/polynomial_shift
- Templates (1):
- Polynomial.cpp
- Resources (1):
- OGFs, EGFs, differentiation and Taylor shifts By adamant
- Problems (2):
[E]★ Polynomial Taylor Shift[M]★ Binomial Fever
6.2.12 Shift of Sampling Points of Polynomial¶
- ID:
polynomial_shift_sampling_points· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/polynomial_shift_sampling_points
- Resources (1):
- Shift of polynomial sampling points By adamant
- Problems (1):
[E]★ Shift of Sampling Points of Polynomial
6.2.13 Polyomial Division and Remainder¶
- ID:
polynomial_division_and_remainder· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/polynomial_division_and_remainder
- Templates (1):
- Polynomial.cpp
- Resources (1):
- Euclidean division | CP Algorithm
- Problems (2):
[M]★ Division of Polynomials[H]Basis Change
6.2.14 Polynomial Roots Under a Modulo¶
- ID:
polynomial_roots_under_modulo· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/polynomial_roots_under_modulo
- Resources (2):
- ★ A bit more of general ideas By adamant
- [問題案] mod p equation | Discussion
- Problems (2):
[M]★ Polynomial Root Finding (Mod 998244353)[H]Irrational Root
6.2.15 Resultant of Two Polynomials and Half-GCD Algorithm¶
- ID:
resultant_of_two_polynomials· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/resultant_of_two_polynomials
- Templates (1):
- Polynomial.cpp
- Resources (2):
- Resultant and Half-GCD | CP Algorithms
- ★ Half-GCD algorithm By adamant
- Problems (2):
[M]★ Find Linear Recurrence[H]Inv of Polynomials
6.2.16 Lagrange Interpolation¶
- ID:
lagrange_interpolation· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/lagrange_interpolation
- Templates (2):
- Lagrange Interpolation.cpp
- Lagrange Interpolation with Polynomial Extraction.cpp
- Resources (3):
- ★ [TUTORIAL] Basic Lagrange Interpolation By grhkm
- The Application of Lagrange Interpolation in Mathematics By luosw
- Lagrange interpolation and partial fraction decomposition By adamant
- Problems (17):
[E]★ The Sum of the k-th Powers[E]A Summatory (HARD)[M]★ Count Arrays[M]★ Some Sums[M]The Boss on Mars[M]A Summatory (Extreme)[M]見たことのない多項式[M]★ Cowmpany Cowmpensation[M]★ Battle Of The Bastards - Kings Vs Rooks[M]★ Guess the Root[H]★ GCD of the Submasks[H]Power Sum[H]★ Euler Totient Function Extended[H]Chef and the Combination Lock[H]★ calc[VH]★ Counting Good Arrays[VH]★ A Lazy Statement
6.2.17 [Problem] Sum of r^i * poly(i)¶
- ID:
polynomial_sum· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/polynomial_sum
- Templates (1):
- Polynomial Sum.cpp
- Resources (1):
- Discussion on library checker
- Problems (1):
[E]★ Sum of exponential times polynomial
6.2.18 Polynomial with Binomial Coefficients¶
- ID:
polynomial_with_binomial_coefficients· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/polynomial_with_binomial_coefficients
- Templates (1):
- Polynomial with Binomial Coefficients.cpp
- Resources (1):
- Binomial coefficients as a basis for the space of polynomials
- Problems (1):
[E]★ The Sum of the k-th Powers
6.2.19 Subset Sum Problem using Generating Functions¶
- ID:
subset_sum_problem_using_generating_functions· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/subset_sum_problem_using_generating_functions
- Templates (1):
- Subset Sum Problem.cpp
- Resources (1):
- PPARTS - Editorial
- Problems (2):
[E]★ Subset Sum[M]★ Perfect Partitions
6.2.20 Polynomial Factorization of (x^n - 1) and Cyclotomic Polynomials¶
- ID:
polynomial_factorization_of_xn_minus_1· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/polynomial_factorization_of_xn_minus_1
- Templates (1):
- Polynomial Factorization.cpp
- Resources (1):
- Cyclotomic polynomial | Wiki
- Problems (1):
[M]★ Call It What You Want
6.2.21 Schwartz–Zippel Lemma¶
- ID:
schwartz_zippel_lemma· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/schwartz_zippel_lemma
- Resources (2):
- Schwartz–Zippel lemma | Wiki
- Hashing and Probability of Collision | rng_58
- Problems (1):
[H]Chef and Lost Story
6.2.22 Lagrange Inversion Theorem¶
- ID:
lagrange_inversion_theorem· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/lagrange_inversion_theorem
- Resources (4):
- ★ Lagrange inversion theorem By adamant
- ★ Lagrange Inversion Formula | [Tutorial] Generating Functions in Competitive Programming (Part 2) By zscoder
- Lagrange inversion theorem | wiki
- Editorial of Problem H - Beautiful Binary Tree
- Problems (2):
[H]Beautiful Binary Tree[VH]Slime and Sequences (Hard Version)
6.3 Matrices¶
Subcategory ID: matrices · Topics: 6
6.3.1 Matrix Exponentiation¶
- ID:
matrix_exponentiation· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/matrix_exponentiation
- Templates (2):
- Matrix Exponentiation.cpp
- Matrix Exponentiation With Polynomial Coefficients.cpp
- Resources (8):
- ★ Matrix Exponentiation tutorial + training contest By Errichto
- ★ Matrix Exponentiation | I, ME AND MYSELF !!!
- ★ [Tutorial]A Complete Guide on Matrix Exponentiation By lazyneuron
- ★ Cool tricks using Matrix Exponential By tweety
- [Discussion] Recurrence using Matrix exponentiation By allrounder
- Min-plus matrix multiplication | Wiki
- Matrix Exponentiation Guide By bfs.07
- Matrix Power Applications ppt | Mostafa
- Problems (44):
[E]★ Matrix Product[E]★ Pow of Matrix[E]Modular Fibonacci[E]★ Random Mood[E]★ Recurrences[E]Fantastic Sequence[E]Experienced Endeavour[E]Sum of products[E]★ String Mood[E]★ Graph Paths I[E]★ Graph Paths II[E]★ Sum of Tetranacci numbers[E]Recursive Sequence[E]Krypton Number System[E]Geometric Progression[M]★ Fibonacci Numbers[M]★ Lunar New Year and a Recursive Sequence[M]★ Fibonacci Power Sum[M]★ R Numbers[M]Decoding Genome[M]Magic Gems[M]★ Wet Shark and Blocks[M]★ Product Oriented Recurrence[M]★ Help Milo![M]Okabe and El Psy Kongroo[M]Blocks for kids[M]★ Nice Patterns Strike Back[M]★ Tiles[M]★ Unlucky Strings[M]★ Kings in Chessboard[M]★ ABCD Strings[M]★ Smile House[M]★ Knight Paths[M]★ Recurrence With Square[M]String Mood Updates[M]★ Count Paths Queries[M]Flibonakki[M]Bacterial Sampling[M]★ Xor-sequences[M]★ Sasha and Array[M]Walk[M]Yet Another Number Sequence[H]★ PolandBall and Many Other Balls[H]Paimon Segment Tree
6.3.2 Permanent of a Matrix¶
- ID:
permanent_of_a_matrix· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/permanent_of_a_matrix
- Templates (1):
- Permanent of a Matrix.cpp
- Resources (2):
- ★ Permanent (mathematics) | Wiki
- ★ Ryser formula | Wiki
- Problems (1):
[VH]★ Permanent
6.3.3 Freivald's Algorithm¶
- ID:
freivalds_algorithm· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/freivalds_algorithm
- Templates (1):
- Freivalds Algorithm.cpp
- Resources (2):
- ★ Freivalds' algorithm | Wiki
- Freivalds’ algorithm for verifying Matrix Multiplication
- Problems (1):
[E]★ Matrix God
6.3.4 Vandermonde Matrix¶
- ID:
vandermonde_matrix· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/vandermonde_matrix
- Templates (1):
- Vandermonde Matrix.cpp
- Resources (2):
- ★ Vandermonde matrix | Wiki
- About Vandermonde Determinant By happyguy656
- Problems (1):
[M]★ Lopymonials
6.3.5 Hafnian of a Matrix / Number of Perfect Matchings in a Graph¶
- ID:
hafnian_of_a_matrix· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/hafnian_of_a_matrix
- Templates (1):
- Hafnian of a Matrix.cpp
- Resources (1):
- Counting perfect matchings as fast as Ryser
- Problems (1):
[E]★ Hafnian of Matrix
6.3.6 Frobenius Form of a Matrix and Fast Matrix Power¶
- ID:
frobenius_form_of_a_matrix· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/frobenius_form_of_a_matrix
- Templates (1):
- 183810
- Resources (1):
- A (Somehow) Simple (Randomized) Algorithm for Frobenius Form of a Matrix By MyBotDear
- Problems (1):
[E]★ Pow of Matrix
6.4 Linear Recurrence¶
Subcategory ID: linear_recurrence · Topics: 8
6.4.1 Linear Recurrence Relations¶
- ID:
linear_recurrence_relations· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/linear_recurrence_relations
- Resources (3):
- ★ Solving Linear Recurrence Relations
- Linear Recurrence Relations | Brilliant
- Linear recurrence with constant coefficients | Wiki
- Problems (1):
[M]★ Fibonacci Numbers
6.4.2 Linear Recurrence using Cayley-Hamilton Theorem in O(N^2 log K)¶
- ID:
linear_recurrence_using_cayley_hamilton_theorem· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/linear_recurrence_using_cayley_hamilton_theorem
- Templates (1):
- Linear Recurrence.cpp
- Resources (1):
- ★ Linear recurrence using Cayley-Hamilton theorem | djdolls
- Problems (3):
[M]Magic Gems[H]Mr. Kitayuta's Gift[H]Costly Strings
6.4.3 Linear Recurrence using Generating Functions in O(N log N log K)¶
- ID:
linear_recurrence_using_generating_functions· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/linear_recurrence_using_generating_functions
- Templates (1):
- Linear Recurrence Fastest.cpp
- Resources (5):
- ★ [Tutorial] Solving Linear Recurrences with various methods, Including O(N logN logK) using FFT By demoralizer
- [Tutorial] Easy Introduction to Kitamasa Method By Justice_Hui
- ★ [tutorial] Bostan-Mori, an elegant algorithm to compute k-th term of linear recurrence in O(dlgdlgk) By Misuki
- ★ On linear recurrences and the math behind them By adamant
- RNG - Editorial
- Problems (3):
[E]★ Kth term of Linearly Recurrent Sequence[M]★ Random Number Generator[VH]★ Tenkei90's Last Problem
6.4.4 Linear Recurrence with Polynomial Coefficients¶
- ID:
linear_recurrence_with_polynomial_coefficients· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/linear_recurrence_with_polynomial_coefficients
- Templates (1):
- Linear Recurrence With Polynomial Coefficients.cpp
- Resources (1):
- Blog by min_25
6.4.5 Linear Recurrence on Matrices¶
- ID:
linear_recurrence_on_matrices· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/linear_recurrence_on_matrices
- Resources (1):
- ★ PANIC - Editorial | YouKn0wWho
- Problems (1):
[H]★ Panic! at the Disco
6.4.6 Generating Function of a Linear Recurrence¶
- ID:
generating_function_of_a_linear_recurrence· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/generating_function_of_a_linear_recurrence
- Templates (1):
- Generating Function of a Linear Recurrence.cpp
- Resources (2):
- ★ GENERATING FUNCTIONS AND RECURRENCE RELATIONS
- Linear Recurrences and Rational Generating Functions
- Problems (2):
[M]★ Perfect Strings[H]★ Expected Value
6.4.7 Berlekamp Massey¶
- ID:
berlekamp_messey· Difficulty: Hard · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/berlekamp_messey
- Templates (1):
- BerleKamp Massey.cpp
- Resources (3):
- ★ Trivialize Linear Recurrence Problems with Berlekamp-Massey! | mzhang2021
- ★ Linear Recurrence and Berlekamp-Massey Algorithm By TLE
- Recovering a linear recurrence with the extended Euclidean algorithm By adamant
- Problems (14):
[M]★ Find Linear Recurrence[M]★ R Numbers[M]Yet Another Number Sequence[M]★ Fibonacci Power Sum[M]Even Odd Partition[M]A Way Out[M]★ Wet Shark and Blocks[M]★ Recurrence With Square[M]★ IFibonacci Power Sum[H]Cube[H]Mr. Kitayuta's Gift[H]★ Expected Value[H]★ Panic! at the Disco[H]完美的旅行
6.4.8 Reeds-Sloane Algorithm¶
- ID:
reeds_sloane_algorithm· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/reeds_sloane_algorithm
- Templates (1):
- Reeds Sloane Algorithm.cpp
- Resources (2):
- Comment Thread
- Shift Register Synthesis (Modulo m ) | Paper by Reeds and Sloane
- Problems (2):
[E]★ Find Linear Recurrence[H]Travelling Knight 2
6.5 Linear Algebra¶
Subcategory ID: linear_algebra · Topics: 18
6.5.1 Gaussian Elimination¶
- ID:
gaussian_elimination· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/gaussian_elimination
- Templates (2):
- Gaussian Elimination.cpp
- Gaussian Elimination Modular.cpp
- Resources (5):
- ★ Math 2331 - 17040: Linear Algebra | Dr. Jiwen He
- ★ Gauss method for solving system of linear equations | CP Algorithms
- ★ Finding the rank of a matrix | CP Algorithms
- 2 Special cases of Gaussian [Tutorial] By MazzForces
- The Fear of Gaussian Elimination By godmar
- Problems (17):
[E]★ System of Linear Equations[E]★ Graph Coloring[E]★ Going to school[E]Knight Moving[E]Central Heating[E]Snakes and Ladders[M]Humpty Dumpty[M]Kirchhoff's Law[M]★ Rank of Matrix[M]★ Nikifor[M]★ Guess the Root[M]Boom Bot[M]Palindromes[H]★ No Game No Life[H]★ Cost of Living[H]Basis Change[H]Circles of Waiting
6.5.2 Gaussian Elimination Modulo 2¶
- ID:
gaussian_elimination_modulo_2· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/gaussian_elimination_modulo_2
- Templates (1):
- Gaussian Elimination Modulo 2.cpp
- Resources (2):
- ★ Gaussian elimination over GF(2)
- ★ Solving modular SLAE | CP Algorithms
- Problems (3):
[M]★ Subsets Forming Perfect Squares[M]★ Rank of Matrix (Mod 2)[M]★ Modifying SAT
6.5.3 Determinant of a Matrix¶
- ID:
determinant_under_prime_modulo· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/determinant_under_prime_modulo
- Templates (1):
- Determinant under Prime Modulo.cpp
- Resources (4):
- ★ Determinant | Wiki
- ★ Calculating the determinant of a matrix by Gauss | CP Algorithms
- Calculating the determinant using Kraut method | CP Algorithms
- ★ Math 2331 - 17040: Linear Algebra | Dr. Jiwen He
- Problems (3):
[E]★ Determinant of Matrix[M]★ Determinant of Matrix (Mod 2)[H]Wizards and Bets
6.5.4 Determinant under Composite Modulo¶
- ID:
determinant_under_composite_modulo· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/determinant_under_composite_modulo
- Templates (1):
- Determinant under Composite Modulo.cpp
- Resources (1):
- Discussion on Library Checker
- Problems (3):
[E]★ Determinant of Matrix (Arbitrary Mod)[E]Find The Determinant III[M]Integer-valued Complex Determinant
6.5.5 Characteristic Polynomial and Hesserberg Matrix¶
- ID:
characteristic_polynomial· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/characteristic_polynomial
- Templates (1):
- Characteristic Polynomial Faster.cpp
- Resources (4):
- ★ Characteristic polynomial
- ★ Cayley–Hamilton theorem | Wiki
- ★ Hessenberg matrix | Wiki
- Discussion on Library Checker
- Problems (2):
[M]★ Determinant[M]★ Characteristic Polynomial
6.5.6 [Problem] Determinant of Product Matrix¶
- ID:
determinant_of_product_matrix· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/determinant_of_product_matrix
- Templates (1):
- Determinant of Product Matrix.cpp
- Problems (1):
[E]★ Determinant Strikes Back
6.5.7 Determinant of Sparse Matrix and Black Box Linear Algebra¶
- ID:
determinant_of_sparse_matrix· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/determinant_of_sparse_matrix
- Templates (1):
- Determinant of Sparse Matrix.cpp
- Resources (2):
- ★ Nice trick involving sparse matrix exponentiation (kind-of) By bicsi
- ★ Black box linear algebra | anta
- Problems (3):
[E]★ Determinant of Sparse Matrix[H]★ Panic! at the Disco[H]Walk on Tree
6.5.8 [Problem] Determinant of Permutant and Circulant Matrix¶
- ID:
determinant_of_permutant_matrix· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/determinant_of_permutant_matrix
- Templates (1):
- Determinant of Permutant Matrix.cpp
- Resources (3):
- Editorial of Problem G. Permutant
- Circulant matrix | Wiki
- Polynomials and roots of unity By adamant
- Problems (2):
[E]★ Permutant[H]Cyclic Cipher
6.5.9 GCD Determinant / Smith's Determinant¶
- ID:
gcd_determinant· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/gcd_determinant
- Resources (2):
- ★ The Determinants of GCD Matrices | Zhongshan Li
- On Smith's determinant
- Problems (2):
[E]★ Find The Determinant II[E]★ Find The Determinant
6.5.10 Cauchy–Binet formula¶
- ID:
cauchy_binet_formula· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/cauchy_binet_formula
- Resources (1):
- Cauchy–Binet formula | Wiki
- Problems (1):
[M]★ Cucumber Boy and Cucumber Girl
6.5.11 Inverse of a Matrix¶
- ID:
inverse_of_a_matrix· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/inverse_of_a_matrix
- Templates (1):
- Inverse of A Matrix.cpp
- Resources (1):
- ★ Math 2331 - 17040: Linear Algebra | Dr. Jiwen He
- Problems (1):
[E]★ Inverse Matrix
6.5.12 Inverse of a Matrix modulo 2¶
- ID:
inverse_of_a_matrix_modulo_2· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/inverse_of_a_matrix_modulo_2
- Templates (1):
- Inverse of A Matrix modulo 2.cpp
- Problems (2):
[E]★ Inverse Matrix (Mod 2)[M]★ Permutations
6.5.13 Thomas Algorithm¶
- ID:
thomas_algorithm· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/thomas_algorithm
- Templates (1):
- Thomas Algorithm.cpp
- Resources (1):
- Tridiagonal matrix algorithm | Wiki
- Problems (1):
[M]★ Slime and Biscuits
6.5.14 Vector Space and XOR Basis¶
- ID:
basis_vector· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/basis_vector
- Templates (1):
- Basis Vector.cpp
- Resources (7):
- ★ Math 2331 - 17040: Linear Algebra | Dr. Jiwen He
- ★ XOR Basis Presentation | Benq
- ★ A Beautiful Technique for Some XOR Related Problems By DrSwad
- ★ Linear Basis (Xor Basis Extended) By errorgorn
- XOR Space | Competitive Programming Winning Technique 2 | Gaussian Elimination | Vivek Gupta
- XOR basis without linear algebra By Everule
- 2 Special cases of Gaussian [Tutorial] By MazzForces
- Problems (29):
[E]★ Maximum Subset Sum[E]★ XOR Maximization[E]★ Godzilla and Pretty XOR[E]★ Xor Closure[M]★ Subsets Forming Perfect Squares[M]★ Square Subsets[M]★ Mahmoud and Ehab and yet another xor task[M]★ Ivan and Burgers[M]Xor Battle[M]★ (Zero XOR Subset)-less[M]★ Shortest Path Problem?[M]Magical Permutation[M]★ Bitsetbaba and Power Grid[M]★ Chef & Chutneys[M]★ Xor Query[M]Spices[M]Xor Sum 3[M]Gambling Nim[M]★ The Tree Has Fallen![M]★ Even XOR[M]★ Uncle Bob and XOR Sum[M]Two Faced Hobz[H]★ Maximaze XOR sum[H]★ Duff as a Queen[H]★ Chiori and Doll Picking (easy version)[H]Around the World[H]★ Increasing Xor[H]Gellyfish and Forget-Me-Not[VH]★ AB=C Problem
6.5.15 [Technique] XOR Basis ft Reduced Row Echelon Form¶
- ID:
basis_vector_reduced_row_echelon_form· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/basis_vector_reduced_row_echelon_form
- Templates (1):
- Basis Vector Reduced Row Echelon Form.cpp
- Resources (1):
- Reduced row echelon form | Wiki
- Problems (1):
[H]★ Find the XOR
6.5.16 [Technique] XOR Basis ft Lexicographically Largest Basis¶
- ID:
basis_vector_ft_lexicographically_largest_basis· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/basis_vector_ft_lexicographically_largest_basis
- Templates (1):
- Basis Vector ft Weighted Linearly Independent Vectors.cpp
- Resources (1):
- ★ A comment by jiangly
- Problems (4):
[M]★ Ivan and Burgers[M]★ The Tree Has Fallen![M]★ Easy Win[M]★ Trees and XOR Queries Again
6.5.17 XOR Basis with Deletions (Online)¶
- ID:
basis_vector_with_deletions· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/basis_vector_with_deletions
- Templates (1):
- 7u074ngkv127l3fl0m33bf5gck
- Resources (1):
- ★ XOR Basis with deletions by denisovkostya
- Problems (1):
[M]★ Beauty Permutation Queries
6.5.18 q Binomial¶
- ID:
q_binomial· Difficulty: Very Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/q_binomial
- Templates (1):
- q Binomial.cpp
- Resources (4):
- ★ Combinatorics of Vector Spaces over Finite Fields | An Abstract of the Thesis of Geoffrey Critzer
- Gaussian binomial coefficient | Wiki
- Moment-generating functions, inversions and q-analogs By adamant
- Note -「q-analog」组合意义灭天地
- Problems (5):
[E]★ q-Binomial Coefficient (Prime Mod)[M]★ Matrix Rank (Hard Version)[M]★ October 18, 2017[H]Many Xor Optimization Problems[H]★ make 1
6.6 Formulas¶
Subcategory ID: formulas · Topics: 4
6.6.1 Gauss's Eureka Theorem¶
- ID:
gausss_eureka_theorem· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/gausss_eureka_theorem
- Resources (1):
- Integer is Sum of Three Triangular Numbers | Wiki
- Problems (1):
[E]★ Palindromicity
6.6.2 Titu's Lemma¶
- ID:
titus_lemma· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/titus_lemma
- Resources (2):
- ★ Titu's Lemma | Brilliant
- ★ A comment by Alpha_Q
- Problems (2):
[E]★ Inventory[E]★ Betting Business
6.6.3 Lifting-the-exponent(LTE) Lemma¶
- ID:
lte_lemma· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/lte_lemma
- Resources (2):
- ★ Lifting-the-exponent lemma | Wiki
- Lifting The Exponent Lemma (LTE) | Amir Hossein Parvardi
6.6.4 Faulhaber's Formula and Bernoulli Numbers¶
- ID:
faulhabers_formula· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/faulhabers_formula
- Templates (1):
- Faulhaber Formula Fastest.cpp
- Resources (2):
- ★ Faulhaber's formula | Wiki
- Bernoulli number | Wiki
- Problems (3):
[M]Black Hole[H]★ Series Sum[H]★ Coprime Power Sum
6.7 Calculus¶
Subcategory ID: calculus · Topics: 2
6.7.1 Differentiation and Integration¶
- ID:
integration· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/integration
- Templates (2):
- Integration (Simpsons).cpp
- Integration (Romberg).cpp
- Resources (5):
- ★ Differentiation | Brilliant
- ★ Finding Maxima and Minima using Derivatives | Math is Fun
- ★ Integration | Brilliant
- ★ Simpson's rule | Wiki
- ★ Romberg's method | Wiki
- Problems (12):
[E]★ Simple Differentiation[E]Differentiation[E]★ Train Station[M]Environment Protection[M]★ Speed Zones[M]Curvy Little Bottles[M]GM-pineapple[M]Tough Water Level[M]Sphere[H]★ The area of the union of circles[VH]★ Minimize the Distance[VH]Imagine Polygons
6.7.2 Line Integral¶
- ID:
line_integral· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/line_integral
- Resources (2):
- ★ Arc Length | Math is Fun
- Line Integral | Brilliant
6.8 Probabilities and Expected Values¶
Subcategory ID: probabilities_and_expected_values · Topics: 6
6.8.1 Probabilities and Expected Values¶
- ID:
probabilities_and_expected_values· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/probabilities_and_expected_values
- Resources (2):
- ★ Sums and Expected Value — part 1 By Errichto
- ★ UNDERSTANDING PROBABILITIES | supernova
- Problems (54):
[E]★ Die Roll[E]★ Archer[E]★ Dreamoon and WiFi[E]★ Little Pony and Expected Maximum[E]★ Random Events[E]★ Wet Shark and Flowers[E]★ Bad Luck Island[E]★ Andrey and Problem[E]What is the Probability ?[E]Journey[E]★ Ilya and Escalator[E]★ Bag of mice[E]★ Airplane[E]★ Bubble Sort[E]Inversions After Shuffle[E]Sakurako's Box[M]★ Ada and Island[M]Martingale[M]★ Game on Tree[M]Proprietary Probabilistic Problem[M]Sugoroku2[M]Guess Game[M]★ LuoTianyi and the Floating Islands (Hard Version)[M]★ Flexible String Revisit[M]Messages[M]Bubble Strike[M]Assimilation IV[M]★ Expected Damage[M]Inversion Expectation[M]Makoto and a Blackboard[M]★ Fish[M]Tickets[M]Basketball Team[M]Falling Anvils[M]Jerry's Protest[M]Jeff and Furik[M]Let's Play Osu![M]Wizards and Huge Prize[M]Lucky Probability[M]Shooting Gallery[M]★ Birthday Paradox[M]Another Sith Tournament[M]Sticker Album[M]Bath Queue[M]Expected Power[H]Good Contest[H]Dstorv[H]Maze[H]Museum[H]★ Birthday[H]ZS Shuffles Cards[H]Inversion Probability[H]T-shirt[VH]★ Gem Island
6.8.2 Expected Value Powers Technique¶
- ID:
expected_value_powers_technique· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/expected_value_powers_technique
- Resources (1):
- ★ Sums and Expected Value — part 2 By Errichto
- Problems (4):
[E]★ Chef Cuts Tree[M]★ Cards[M]Rikka with Subsequences[H]★ Guna Guni
6.8.3 The Slime Trick¶
- ID:
the_slime_trick· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/the_slime_trick
- Resources (1):
- A comment by jqdai0815
- Problems (2):
[M]★ Slime and Biscuits[H]★ Company Acquisitions
6.8.4 Expected Occurrence Time as Substring¶
- ID:
expected_occurrence_time_as_substring· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/expected_occurrence_time_as_substring
- Resources (3):
- ★ [Tutorial] Expected number of coin flips required to achieve a given string By gabrielwu
- ★ Editorial of Problem R2 06: Monkey at the Keyboard (ID: 1677)
- Disucussion by aid
- Problems (3):
[M]★ Monkey at the Keyboard[M]Flip a Coin[H]Monkey's Keyboard
6.8.5 Gambler's Ruin¶
- ID:
gamblers_ruin· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/gamblers_ruin
- Resources (3):
- ★ Gambler's ruin | Wiki
- Gambler’s Ruin Problem | columbia.edu
- Random Walks | MIT
- Problems (2):
[M]PointSystem[M]CatsOnTheCircle
6.8.6 Martingale¶
- ID:
martingale· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/martingale
- Resources (2):
- Martingale (probability theory) | Wiki
- ★ Probability 101, the intuition behind martingales and solving problems with them By nor
- Problems (7):
[M]★ Slime and Biscuits[H]ZS Shuffles Cards[H]Finding Expected Value[H]★ Company Acquisitions[H]Balance Beam[VH]School Clubs[VH]Rainbow Balls
6.9 Mathematical Optimization¶
Subcategory ID: mathematical_optimization · Topics: 3
6.9.1 Lagrange Multiplier¶
- ID:
lagrange_multiplier· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/lagrange_multiplier
- Templates (1):
- Lagrange Multiplier.cpp
- Resources (2):
- ★ Lagrange multiplier | Wiki
- Lagrange Multipliers for "Core Training" (Code Jam 2017, Round 1C) By choice
- Problems (7):
[E]★ Betting Business[E]Mushroom Scientists[M]★ Speed Zones[M]★ Highway Cycling[M]Samantha and Portfolio Management[H]★ Coprime Power Sum[H]★ Random Number Generator
6.9.2 Linear Programming / Simplex Algorithm¶
- ID:
simplex_algorithm· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/simplex_algorithm
- Templates (1):
- Simplex Algorithm.cpp
- Resources (2):
- Simplex algorithm | Wiki
- Alternative Solution to 1421 D. Hexagons using Linear Programming & Total Unimodularity By eyfmharb
- Problems (3):
[M]★ Freelancer's Dreams[M]01 Sequence[H]★ Red and Black Tree
6.9.3 Duality in Linear Programming (LP <> Flow)¶
- ID:
duality_in_linear_programming· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/duality_in_linear_programming
- Resources (3):
- ★ Duality in linear programming. Part 1 — definition and construction By adamant
- ★ Duality in linear programming. Part 2 — in competitive programming By adamant
- Dual flows and algorithms | Laurent Lessard
- Problems (10):
[E]★ Minimum Cost b-flow[M]★ Freelancer's Dreams[H]Fishingprince Plays With Array Again[H]Roads[H]Utilitarianism[H]Yet Another DAG Problem[H]Hiring Employees[H]Snack[VH]★ Cow and Exercise[VH]Security Camera 2
6.10 Miscellaneous¶
Subcategory ID: miscellaneous · Topics: 3
6.10.1 Continued Fractions¶
- ID:
continued_fractions· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/continued_fractions
- Templates (1):
- Continued Fractions.cpp
- Resources (3):
- ★ On continued fractions. Part 1: Introduction By adamant
- On continued fractions. Part 2: Properties and interpretation By adamant
- Continued Fractions | Brilliant
- Problems (1):
[E]Continued Fractions
6.10.2 Polynomial Real Roots¶
- ID:
polynomial_root_finding· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/polynomial_root_finding
- Resources (1):
- ★ Newton's method for finding roots | CP Algorithms
- Problems (1):
[E]★ The Roots
6.10.3 Finite Field Arithmetic Binary¶
- ID:
finite_field_arithmetic_binary· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/finite_field_arithmetic_binary
- Templates (1):
- Finite Field Arithmetic Binary.cpp
- Resources (1):
- Finite field arithmetic | Wiki
- Problems (1):
[M]★ Even Coefficients
7. Strings¶
Category ID: strings · Subcategories: 7 · Topics: 31
7.1 String Matching¶
Subcategory ID: string_matching · Topics: 4
7.1.1 Knuth Morris Pratt (KMP) and Prefix Automaton¶
- ID:
kmp· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/kmp
- Templates (2):
- KMP.cpp
- Prefix Automaton.cpp
- Resources (6):
- ★ Prefix function. Knuth–Morris–Pratt algorithm | CP Algorithms
- ★ (Tutorial) Prefix Function + Pattern Matching (supposedly, KMP) | galencolin
- ★ The Automaton Interpretation for the KMP Algorithm By arthur_9548
- KMP Algorithm (String Matching) Demystified | Girish Budhwani
- Video tutorial on KMP algorithm By vedhant
- Knuth–Morris–Pratt (KMP) (Bangla | বাংলা) #CP Pattern Matching (Substring search)
- Problems (36):
[E]★ String Matching[E]★ Finding Border[E]★ Finding Periods[E]★ Periodic Strings[E]★ String Factoring[E]Dancing the Cheeky-Cheeky[E]Caesar Cipher[E]★ Pattern Find[E]A Needle in the Haystack[E]Secret Word[E]★ MUH and Cube Walls[E]War of the Corporations[E]String Functions[E]Order-Preserving Codes[E]Message Transmission Error (hard version)[M]Prefixes and Suffixes[M]★ Extend to Palindrome[M]★ Power Strings[M]Period[M]★ Anthem of Berland[M]★ Required Substring[M]★ Lucky Common Subsequence[M]★ Matrix Matcher[M]★ Password[M]Tavas and Malekas[M]★ Obsessive String[M]Messenger[M]★ String Transformation[M]★ Finding Palindromes[M]★ Bracket Substring[M]Cow Patterns[M]★ Tree-String Problem[M]★ Unlucky Strings[M]String Compression[M]Test[H]★ Pty loves string
7.1.2 Z algorithm¶
- ID:
z_algorithm· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/z_algorithm
- Templates (1):
- Z Algorithm.cpp
- Resources (2):
- ★ Z-function and its calculation | CP Algorithms
- Z Algorithm By paladin8
- Problems (18):
[E]★ Z Algorithm[E]★ String Matching[E]★ Finding Periods[E]★ Finding Border[E]★ Pattern Find[E]A Needle in the Haystack[E]★ MUH and Cube Walls[E]String Functions[E]Query Problem[E]★ Periodic Strings[E]★ String Factoring[M]★ Extend to Palindrome[M]Tavas and Malekas[M]★ String Transformation[M]Prefixes and Suffixes[M]★ Password[M]★ Division + LCP (hard version)[H]★ Copy and Paste
7.1.3 String Matching using Bitsets¶
- ID:
string_matching_using_bitsets· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/string_matching_using_bitsets
- Templates (1):
- String Matching using Bitsets.cpp
- Resources (1):
- String Matching using Bitset
- Problems (7):
[E]★ Dasha and cyclic table[M]★ Frequency of String[M]Yet Another String Matching Problem[M]Substring Search[M]★ Fuzzy Search[H]★ Substrings in a String[H]Design Tutorial: Increase the Constraints
7.1.4 String Matching with FFT ft Wildcard Matching¶
- ID:
string_matching_with_fft· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/string_matching_with_fft
- Templates (1):
- String Matching With FFT.cpp
- Resources (3):
- ★ Interesting problem involving convolutions By snacache
- ★ Simple Deterministic Wildcard Matching Peter Clifford and Raphael Clifford
- ★ [Tutorial] On Variations of String Matching By brunomont
- Problems (11):
[E]★ Ada and Nucleobase[E]★ Maximum Self-Matching[E]★ K-Inversions[M]★ Another Repeated String Problem[M]★ Fuzzy Search[M]Rusty String[M]Substring Search[M]★ Mosaic Browsing[M]Yet Another String Matching Problem[M]★ Wildcard Pattern Matching[H]★ Zimpha Fan Club
7.2 Hashing¶
Subcategory ID: hashing · Topics: 4
7.2.1 String Hashing¶
- ID:
string_hashing· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/string_hashing
- Templates (1):
- String Hashing.cpp
- Resources (6):
- ★ String Hashing | CP Algorithms
- Rabin-Karp Algorithm for string matching | CP Algorithms
- ★ [Tutorial] Rolling hash and 8 interesting problems [Editorial] By dmkz
- 26.3 String hashing | CPH
- ★ How to blow up too weak hashing without thinking By physics0523
- On the mathematics behind rolling hashes and anti-hash tests
- Problems (41):
[E]★ String Matching[E]★ Pattern Find[E]A Needle in the Haystack[E]★ MUH and Cube Walls[E]★ String Hashing[E]★ Finding Border[E]★ Finding Periods[E]★ Minimal Rotation[E]★ Longest Palindrome[E]★ Enumerate Palindromes[E]★ Longest Common Substring[E]★ Good Substrings[E]★ Ada and Spring Cleaning[E]★ Non-Palindromic Substring[E]★ Product Equality[E]★ Palindromic Partitions[M]Kefa and Watch[M]Digit Tree[M]★ Unique Substrings Query[M]★ Extend to Palindrome[M]★ Power Strings[M]★ Password[M]★ String Transformation[M]★ Palindrome Queries[M]Double Profiles[M]The Gift Of Raksha Bandhan[M]Detection of Extraterrestrial[M]★ Games on a CD[M]Buzzwords[M]String Compression[M]★ Palindromic characteristics[M]Test[M]Gift Boxes[M]Deletion of Repeats[M]★ Palindrome Degree[M]★ Jitu and Strings[M]★ Strings - 3[M]★ Searching for Strings[M]Check Transcription[M]★ Fullmetal Alchemist II[H]SubInversing
7.2.2 2D String Hashing¶
- ID:
2d_string_hashing· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/2d_string_hashing
- Templates (1):
- String Hashing 2D.cpp
- Resources (1):
- Hashing a board
- Problems (2):
[E]★ Grid search[M]★ Matrix Matcher
7.2.3 XOR Hashing¶
- ID:
xor_hashing· Difficulty: Medium · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/xor_hashing
- Resources (2):
- ★ XOR Hashing [TUTORIAL] By humbertoyusta
- ★ An analysis on the error rate of Zobrist Hashing (Xor Hashing) By kinoud
- Problems (16):
[E]Robin Hood Archery[M]★ Three Occurrences[M]★ Square Subsets[M]★ Hossam and Range Minimum Query[M]★ The Number of Subpermutations[M]EP-Palindromes[M]★ Prefix Equality[M]G2. Light Bulbs (Hard Version)[M]★ Is It A Square?[M]★ XORificator[H]★ The Untended Antiquity[H]★ Hyperregular Bracket Strings[H]★ Number Game on a Tree[H]Quadratic Set[H]★ Kazaee[H]Odd Mineral Resource
7.2.4 Multiset Hashing¶
- ID:
multiset_hashing· Difficulty: Medium · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/multiset_hashing
- Resources (1):
- Hashing and Probability of Collision | rng_58
- Problems (6):
[E]★ Rearrange Query[M]★ Searching for Strings[M]Amer and Graphs[M]Ivan Pesic and His World Tour[H]★ Cloning[H]★ Frequency Mismatch (Hard Version)
7.3 Aho Corasick¶
Subcategory ID: aho_corasick · Topics: 2
7.3.1 Aho Corasick¶
- ID:
aho_corasick· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/aho_corasick
- Templates (2):
- Aho Corasick.cpp
- Aho Corasick All Pair Occurrence Relation.cpp
- Resources (3):
- ★ Aho-Corasick algorithm | CP Algorithms
- ★ Aho-Coresick algorithm By Pavel Mavrin
- Aho-Corasick algorithm. Construction By adamant
- Problems (20):
[E]★ Finding Patterns[E]★ Counting Patterns[E]Substring Frequency (II)[E]★ String Multimatching[E]Prefix Lookup[E]SMS[E]I Love Strings!![E]Obscene Words Filter[E]Censored![M]★ e-Government[M]★ Word Combinations[M]★ ABCD Strings[M]Passwords[M]★ Frequency of String[M]x-prime Substrings[M]Buying a New String[M]★ Bracket Groups[H]A task for substrings[H]Indie Album[VH]★ Birthday
7.3.2 Dynamic Aho Corasick¶
- ID:
dynamic_aho_corasick· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/dynamic_aho_corasick
- Templates (1):
- Aho Corasick Dynamic.cpp
- Resources (2):
- ★ Aho-Corasick with additions
- Idea 4 of General ideas By adamant
- Problems (1):
[M]★ String Set Queries
7.4 Suffix Structures¶
Subcategory ID: suffix_structures · Topics: 6
7.4.1 Suffix Array¶
- ID:
suffix_array· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/suffix_array
- Templates (1):
- Suffix Array.cpp
- Resources (3):
- ★ Suffix Array | CP Algorithms
- ★ Suffix Array » Step 1-5 | CF EDU
- A tutorial on Suffix Arrays | kuruma
- Problems (47):
[E]★ Suffix Array[E]★ Suffix Array and LCP[E]★ Substring Search[E]★ Counting Patterns[E]★ Distinct Substrings[E]★ Repeating Substring[E]★ Sorting Substrings[E]★ Substring Order I[E]★ Substring Order II[E]★ Lexicographical Substring Search[E]★ Substring Distribution[E]Number of Substrings[E]★ Longest Common Substring[E]★ Longest Common Substring II[E]★ Ada and Spring Cleaning[E]★ Pattern Positions[E]Editor[E]★ Substrings and Repetitions[E]Ada and Terramorphing[E]JARVIS and LCP[E]The longest constant gene[E]Martian Strings[M]★ Substring Symphony[M]★ Frequency of String[M]Liar[M]Entangled Strings[M]Top 10[M]File Recover[M]Stammering Aliens[M]★ Forbidden Indices[M]★ Fake News (hard)[M]★ Borders[M]★ Refrain[M]★ Periodic Substring[M]Two Prefixes[M]Standing Out from the Herd[M]Common Prefixes[H]★ Rabbit's String[H]★ Paper task[H]★ Tandem[H]Tricky and Clever Password[H]★ Little Elephant and Strings[H]★ Misha and LCP on Tree[H]★ Inverse Suffix Array[H]K-th similar password[H]The Story of Stringland[VH]Divljak
7.4.2 Isomorphic Suffix Array¶
- ID:
isomorphic_suffix_array· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/isomorphic_suffix_array
- Templates (1):
- Suffix Array Isomorphic.cpp
- Problems (1):
[M]★ Similar Strings
7.4.3 Dynamic Suffix Array¶
- ID:
dynamic_suffix_array· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/dynamic_suffix_array
- Templates (2):
- 3SHz0M29
- 2MrMBR
- Resources (1):
- [Tutorial] Dynamic Suffix Arrays By brunomont
- Problems (1):
[M]★ May I Add a Letter?
7.4.4 Suffix Automaton¶
- ID:
suffix_automaton· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/suffix_automaton
- Templates (1):
- Suffix Automaton.cpp
- Resources (3):
- ★ Suffix Automaton | CP Algorithms
- A short guide to suffix automata By quasisphere
- Obtaining suffix array from suffix automaton By adamant
- Problems (21):
[E]★ Finding Patterns[E]★ Counting Patterns[E]★ Distinct Substrings[E]★ Substring Order I[E]★ Substring Order II[E]★ Substring Distribution[E]Number of Substrings[E]★ Pattern Positions[E]★ Longest Common Substring[E]★ Substrings and Repetitions[E]The longest constant gene[E]★ Longest Common Substring II[E]★ Lexicographical Substring Search[E]★ Delicious Dessert[M]★ Forbidden Indices[M]★ Borders[M]★ Refrain[M]★ Cyclical Quest[M]★ Fake News (hard)[M]★ Drawing[H]★ Little Elephant and Strings
7.4.5 [Problem] Distinct Substring Queries in Range¶
- ID:
suffix_automaton_ft_distinct_substring_queries_in_range· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/suffix_automaton_ft_distinct_substring_queries_in_range
- Templates (1):
- Suffix Automaton Distinct Substring Queries in Range.cpp
- Resources (1):
- The history of some recurring problem By adamant
- Problems (4):
[M]★ How Many Substrings?[M]★ To Queue or not to Queue[M]Chef and Substrings[H]★ Incomparable Pairs
7.4.6 Suffix Tree¶
- ID:
suffix_tree· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/suffix_tree
- Templates (1):
- sT8Vd1
- Resources (3):
- ★ Suffix Tree. Ukkonen's Algorithm | CP Algorithms
- Suffix tree. Ukkonen's algorithm By adamant
- Fast String Searching With Suffix Trees: Tutorial by Mark Nelson
- Problems (2):
[M]Equivalent Suffix Tries[M]★ Longest Common Substring
7.5 Palindromes¶
Subcategory ID: palindromes · Topics: 5
7.5.1 Palindromic Tree¶
- ID:
palindromic_tree· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/palindromic_tree
- Templates (1):
- Palindromic Tree.cpp
- Resources (3):
- ★ Palindromic tree By ADJA,
- ★ Palindromic tree: behind the scenes By adamant
- Palindromic Tree Tutorial By karamkontar
- Problems (10):
[E]★ Eertree[E]★ Longest Palindrome[E]★ The Number of Palindromes[E]★ Palindromes and Super Abilities[E]★ Palindromes and Super Abilities 2[E]★ 100500 palidnromes[M]Palisection[M]★ Virus synthesis[M]★ The Problem to Slow Down You[H]★ Palindromadness
7.5.2 Persistent Palindromic Tree¶
- ID:
persistent_palindromic_tree· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/persistent_palindromic_tree
- Templates (2):
- Palindromic Tree Persistent.cpp
- 213595
- Resources (1):
- ★ Double-ended eertree By adamant
- Problems (4):
[E]★ Binary Palindrome[E]★ QueryreuQ[M]★ Momoka[H]★ Palindromes in Deque
7.5.3 Manachers Algorithm¶
- ID:
manachers_algorithm· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/manachers_algorithm
- Templates (1):
- Manachers.cpp
- Resources (2):
- ★ Manacher's Algorithm | CP Algorithms
- Manacher's algorithm and code readability By adamant
- Problems (8):
[E]★ Enumerate Palindromes[E]★ The Number of Palindromes[E]★ Longest Palindrome[E]★ Extend to Palindrome[E]Prefix-Suffix Palindrome (Hard version)[E]★ QueryreuQ[E]★ Non-Palindromic Substring[M]★ Palindromes
7.5.4 [Problem] Minimum Palindrome Factorization¶
- ID:
minimum_palindrome_factorization· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/minimum_palindrome_factorization
- Templates (1):
- Minimum Palindrome Factorization.cpp
- Resources (1):
- A Subquadratic Algorithm for Minimum Palindromic Factorization
- Problems (2):
[E]★ 100500 palidnromes[M]★ Reverses
7.5.5 [Problem] Number of Palindromes in Range¶
- ID:
number_of_palindromes_in_range· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/number_of_palindromes_in_range
- Templates (1):
- Number of Palindromes in Range.cpp
- Resources (1):
- ★ A comment by Noam527
- Problems (2):
[M]★ Palindromes[M]★ Queries for Number of Palindromes
7.6 Longest Common Subsequence (LCS)¶
Subcategory ID: lcs · Topics: 5
7.6.1 Longest Common Subsequence (LCS)¶
- ID:
lcs· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/lcs
- Templates (1):
- 124670
- Resources (6):
- ★ Longest Common Subsequence | Programiz
- ★ Longest Common Subsequence (LCS) | Geeks for Geeks
- Longest Common Subsequence (LCS) in DP Playlist By Algorithms_with_Shayan
- Longest Common Subsequence - Dynamic Programming - Leetcode 1143
- ★ how to find the LCS of two permutations per nlogn By LinkCatList
- ★ Converting LCS to LIS | hriss95
- Problems (5):
[E]★ Longest Common Subsequence[E]★ LCS[E]Three Strings[M]★ Yet another permutation problem[M]★ Gargari and Permutations
7.6.2 All Substring Longest Common Subsequence¶
- ID:
all_substring_longest_common_subsequence· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/all_substring_longest_common_subsequence
- Templates (1):
- All Substring Longest Common Subsequence.cpp
- Resources (2):
- ★ An all-substrings common subsequence algorithm | Paper
- ★ [Tutorial] On Range LIS Queries, Part 1 By ko_osaga
- Problems (5):
[E]★ Total LCS[E]LCS 9[E]Round words[M]★ Prefix-Substring LCS[M]★ Square Subsequences
7.6.3 Bit LCS¶
- ID:
bit_lcs· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/bit_lcs
- Templates (1):
- Bit LCS.cpp
- Resources (1):
- A Bit-String Longest-Common-Subsequence Algorithm
- Problems (1):
[E]★ Longest Common Subsequence
7.6.4 Cyclic LCS¶
- ID:
cyclic_lcs· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/cyclic_lcs
- Templates (1):
- Cyclic LCS.cpp
- Resources (1):
- Solving Cyclic Longest Common Subsequence in Quadratic Time | Andy Nguyen
7.6.5 LCS on RLE compressed string¶
- ID:
lcs_on_rle_compressed_string· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/lcs_on_rle_compressed_string
- Resources (1):
- Matching for Run-Length Encoded Strings
7.7 Miscellaneous¶
Subcategory ID: miscellaneous · Topics: 5
7.7.1 Balanced Brackets¶
- ID:
balanced_brackets· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/balanced_brackets
- Resources (2):
- ★ Balanced bracket sequences | CP Algorithms
- ★ Check for Balanced Brackets in an expression | Geeks for Geeks
- Problems (20):
[E]★ Valid Parentheses[E]★ Bracket Sequences I[E]Jatayu's Balanced Bracket Sequence[E]★ Bracket Subsequence[E]Serval and Parenthesis Sequence[E]Bracket Sequence[E]Replace To Make Regular Bracket Sequence[M]★ Longest Regular Bracket Sequence[M]★ Bracket Sequences II[M]★ Anton and School - 2[M]★ Bracket Substring[M]★ Pieces of Parentheses[M]★ Correct Bracket Sequence Editor[M]★ Streets of Working Lanterns - 2[M]★ Parenthesis Checking[M]★ Sereja and Brackets[M]Invertible Bracket Sequences[M]Most Valuable Parentheses[M]★ Bracket Groups[H]★ Hyperregular Bracket Strings
7.7.2 Expression Parsing¶
- ID:
expression_parsing· Difficulty: Easy · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/expression_parsing
- Templates (1):
- Expression Parsing.cpp
- Resources (1):
- Expression parsing | CP Algorithms
- Problems (8):
[E]★ Expression Parsing[E]Equation[E]★ Transform the Expression[E]★ Evaluate simple RPN expression[E]Tertiary Calculator[M]★ Vanya and Brackets[M]★ Children's Math[M]Equivalent Boolean Expressions
7.7.3 Lyndon Factorization / Duval Algorithm¶
- ID:
lyndon_factorization· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/lyndon_factorization
- Templates (1):
- lyndon_factorization.html
- Resources (3):
- ★ Lyndon factorization | CP Algorithms
- ★ Random notes on Lyndon decomposition By ko_osaga
- Simple Linear and Effectively Duval Algorithm for Lyndon Factorization By SPyofgame,
- Problems (12):
[E]★ Lyndon Factorization[E]★ Minimal Rotation[E]Glass Beads[E]★ Longest Lyndon Prefix[E]Lyndon Words[M]Repetitions[H]★ Run Enumerate[H]★ Decomposition[H]优秀的拆分[H]Cutting the Line[H]★ Cyclic Shifts[VH]Two Sequences
7.7.4 Finding Repetitions / Main-Lorentz Algorithm¶
- ID:
main_lorentz_algorithm· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/main_lorentz_algorithm
- Templates (1):
- main_lorentz.html
- Resources (1):
- ★ Finding repetitions | CP Algorithms
- Problems (3):
[E]★ Repeating Substring[M]Repetitions[H]★ Run Enumerate
7.7.5 De Bruijn Sequence¶
- ID:
de_bruijn_sequence· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/de_bruijn_sequence
- Templates (1):
- De Bruijn Sequence.cpp
- Resources (2):
- ★ de Bruijn sequence | Wiki
- ★ De Bruijn Sequences | USACO Guide
- Problems (2):
[E]★ De Bruijn Sequence[M]★ Matching Substrings
8. Dynamic Programming (DP)¶
Category ID: dynamic_programming · Subcategories: 10 · Topics: 35
8.1 Intro to DP¶
Subcategory ID: intro_to_dp · Topics: 2
8.1.1 Knapsack and Basic Dynamic Programming¶
- ID:
knapsack· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/knapsack
- Resources (14):
- ★ Introduction to Dynamic Programming | CP Algorithms
- ★ Dynamic Programming lecture #1 - Fibonacci, iteration vs recursion | Errichto Algorithms
- ★ Dynamic Programming lecture #2 - Coin change, double counting | Errichto Algorithms
- ★ Dynamic Programming - Learn to Solve Algorithmic Problems & Coding Challenges | freeCodeCamp.org
- ★ 0/1 Knapsack problem | Dynamic Programming WilliamFiset
- ★ 0/1 Knapsack Problem | Geeks for Geeks
- 7.1 Coin problem | CPH
- ★ Removing Items in Subset Sum | Editorial
- ★ A Deep Understanding of Dynamic Programming [Intro / Overview] | Colin Galen
- Introduction to DP | USACO Guide
- Knapsack DP | USACO Guide
- ★ AtCoder DP Editorial | Neo Wang
- Paths on Grids | USACO Guide
- Dynamic Programming Series | TLE_Eliminators
- Problems (52):
[E]★ Dice Combinations[E]★ Knapsack 1[E]★ Coin Combinations I[E]★ Frog 1[E]★ Frog 2[E]★ Removing Digits[E]★ The Values You Can Make[E]★ Grid Paths[E]★ Book Shop[E]★ Array Description[E]Counting Towers[E]★ Money Sums[E]★ Removal Game[E]★ Two Sets II[E]Fruit Feast[E]Vacation[E]★ LCS[E]★ Grid 1[E]★ Coins[E]Talent Show[E]Knapsack[E]Mortal Kombat Tower[E]★ Where is the Ghost[E]Colored Balls[E]Minimizing the Sum[E]Smithing Skill[E]The least round way[E]Arpa's weak amphitheater and Mehrdad's valuable Hoses[E]New Rating[E]Pictures with Kittens (easy version)[M]★ Minimizing Coins[M]★ Coin Combinations II[M]★ #(subset sum = K) with Add and Erase[M]★ Round Subset[M]Cow Poetry[M]Exercise[M]Maximal Orders of Permutations[M]★ Knapsack 2[M]★ Stones[M]Deque[M]★ Candies[M]★ Slimes[M]★ Grid 2[M]Mr. Kitayuta, the Treasure Hunter[M]Knapsack[M]The Unbearable Lightness of Weights[M]Porcelain[M]Ski Lessons[M]★ Yet Another Minimization Problem[H]Cloud computing[H]★ Colorful Subsequence[H]Moorio Kart
8.1.2 Knapsack and Subset Sum Optimizations¶
- ID:
subset_sum_in_sqrt· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/subset_sum_in_sqrt
- Templates (2):
- Bounded Knapsack.cpp
- Subset Sum in SQRT.cpp
- Resources (10):
- ★ Subset sum queries using bitset | Geeks for Geeks
- ★ [Tutorial] Subset Sum Square Root Optimisation By arujbansal
- ★ Decide if a number equals the sum of some submultiset of positive integers By pimenta
- ★ [Tutorial] Knapsack, Subset Sum and the (max,+) Convolution By errorgorn
- ★ Unveiling the Bounded Knapsack Problem Florian June Florian June
- [Tutorial] Optimized solution for Knapsack problem By sdnr1
- ★ [Tutorial] Collection of little techniques By -is-this-fft-
- ★ 27.2 Integer partitions | CPH
- Integral bounded knapsack problem solvable in O(knapsack_size*num_of_items) | Petr
- Bitsets | Knapsack Again | USACO Guide
- Problems (19):
[E]★ Money Sums[E]★ Two Sets II[E]★ Decreasing Game[E]Min-Fund Country[E]★ Ada and Coins[M]★ PolandBall and Gifts[M]★ PermuTree (hard version)[M]★ Median Sum[M]Knapsack[M]Tree Upshot[M]Lucky Country[M]Eavesdropper Evasion[M]★ Subset Sum[M]★ Jumping sequence[M]★ Keyboard[M]★ Count Pairs[M]School Excursion[M]The Values You Can Make[H]★ AB Tree
8.2 Digit DP¶
Subcategory ID: digit_dp · Topics: 1
8.2.1 Digit DP¶
- ID:
digit_dp· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/digit_dp
- Templates (1):
- Digit DP.cpp
- Resources (5):
- ★ Digit DP By flash_7
- Introduction to Digit Dynamic Programming By kartik8800
- DIGIT DP Tutorial [ITERATIVE] By Jon.Snow
- ★ Digit DP "tricks" By gnudgnaoh
- Digit DP Tutorial | Ep - 01 | Complete Explanation | Dynamic Programming | C++ | By Aman Babu
- Problems (29):
[E]★ Counting Numbers[E]★ Investigation[E]★ Digit Sum[E]Maximum Product[E]Magic Numbers[E]★ Digit Count[E]★ Sum of Digits[E]Ra-One Numbers[E]LUCIFER Number[E]369 Numbers[E]Almost Everywhere Zero[E]Digit Sum[E]Little Elephant and Interval[M]★ Noora Number[M]★ Classy Numbers[M]★ Segment Sum[M]★ LIDS[M]★ Palindromic Numbers[M]Chef and Digits[M]Logan and DIGIT IMMUNE numbers[M]Chef and special numbers[M]★ The Great Ninja War[M]Balanced Numbers[M]★ Digit Sum Divisible[M]★ Counting Inversion[M]Sums of Digits[M]Odometer[M]Zebra-like Numbers[H]Sanvi and Magical Numbers
8.3 DP Optimizations¶
Subcategory ID: dp_optimizations · Topics: 5
8.3.1 Divide and Conquer Optimization¶
- ID:
divide_and_conquer_optimization· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/divide_and_conquer_optimization
- Templates (1):
- Divide and Conquer Optimization.cpp
- Resources (6):
- ★ Divide and Conquer DP | CP Algorithms
- ★ Divide & Conquer Dynamic Programming Optimisation, CSES Subarray Squares | Algorithms Conquered
- Dynamic Programming Optimization: Divide and Conquer technique | Tozan Southerpacks Redcoder
- ★ Divide & Conquer - DP | USACO Guide
- [Bangla] Divide and Conquer optimization explained by Anik Sarkar
- What is divide and conquer optimization in dynamic programming? | Quora
- Problems (23):
[E]★ Subarray Squares[E]★ Ciel and Gondolas[E]★ Guardians of the Lunatic[E]★ The Bakery[E]★ Levels and Regions[E]Guards[E]★ Ada and Mold[E]Bicolored Horses[E]Circular Barn[E]Houses and Schools[E]Leaves[M]★ Partition Game[M]Yakiniku Restaurants[M]★ Yet Another Minimization Problem[M]Chef and Bitwise OR Operation[M]Mining[M]★ Money for Nothing[M]Lannister Army[M]Two Sawmills[M]Nafta[M]★ Branch Assignment[M]Trucks and Cities[H]Candies and Stones
8.3.2 Knuth Optimization¶
- ID:
knuth_optimization· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/knuth_optimization
- Templates (1):
- Knuth Optimization.cpp
- Resources (4):
- ★ Knuth's Optimization | CP Algorithms
- ★ What is Knuth's optimization in dynamic programming? | Quora
- Knuth’s Optimization in Dynamic Programming | Geeks for Geeks
- Quadrangle Inequality Properties By upobir
- Problems (7):
[E]★ Breaking Strings[E]★ Knuth Division[E]★ Cutting Sticks[E]Prefix Codes[E]★ Optimal Binary Search Tree[E]Trucks and Cities[M]Gain Battle Power
8.3.3 Aliens Trick / WQS Binary Search¶
- ID:
aliens_trick· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/aliens_trick
- Resources (6):
- ★ My Take on Aliens' Trick | Mamnoon Siam
- ★ Theoretical grounds of lambda optimization By adamant
- ★ Incredibly beautiful DP optimization from N^3 to N log^2 N By linkret
- The Trick From Aliens | SERBANOLOGY
- VK cup eliminations — Levels and Regions — higher limits By Radewoosh
- Lagrangian Relaxation | USACO Guide
- Problems (14):
[E]★ New Year and Handle Change[E]★ Levels and Regions[E]Two Famous Companies[M]★ Feast[M]Building a Tall Barn[M]★ Gosha is hunting[M]★ Teleporters[M]Blazing New Trails[M]Akvizna[H]★ Aliens[H]Popcorn[H]Honorable Mention[H]Timofey and Docker[VH]April Fools' Problem (hard)
8.3.4 1D1D DP Optimization¶
- ID:
1d1d_dp_optimization· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/1d1d_dp_optimization
- Templates (1):
- 1D1D DP.cpp
- Resources (3):
- ★ 1D1D-optimization By seiko.iwasawa
- ★ 1D/1D Dynamic Programming Optimization - Part I
- DP optimization | A Simple Blog
- Problems (2):
[E]★ Batch Scheduling[E]★ Kalila and Dimna in the Logging Industry
8.3.5 DP Optimization using Data Structures [Some Practice Problems]¶
- ID:
dp_optimization_using_data_structures· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/dp_optimization_using_data_structures
- Resources (2):
- ★ [Tutorial]Using Segment Trees to solve Dynamic Programming problems By AlexLuchianov
- ★ Dynamic Programming Optimizations (Segment Tree, Convex Hull Trick) | Colin Galen
- Problems (22):
[E]★ Increasing Subsequence[E]★ Projects[E]★ Flowers[E]★ Flat Subsequence[E]Smooth Subsequence[M]★ Subsequences[M]Pillars[M]Babaei and Birthday Cake[M]Pathwalks[M]Trains and Statistic[M]★ Word Combinations[M]Intervals[M]Strip[M]Domino Principle[M]★ K-inversions[M]Cutlet[M]Watching Fireworks is Fun[M]Hanoi Factory[M]★ Blocking Elements[H]Linear Kingdom Races[H]Coins Exhibition[H]Pictures with Kittens (hard version)
8.4 Convex Hull Trick (CHT)¶
Subcategory ID: convex_hull_trick · Topics: 2
8.4.1 Convex Hull Trick (CHT) and Dynamic CHT¶
- ID:
cht· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/cht
- Templates (2):
- Convex Hull Trick.cpp
- Dynamic Convex Hull Trick.cpp
- Resources (5):
- ★ [Tutorial] Convex Hull Trick — Geometry being useful By meooow,
- Convex hull trick and Li Chao tree | CP Algorithms
- ★ Episode 11 - Convex Hull Optimization | Algorithms Live!
- Dynamic Programming Optimizations By indy256
- Convex Hull Trick | USACO Guide
- Problems (42):
[E]★ Kalila and Dimna in the Logging Industry[E]★ Frog 3[E]★ Bear and Bowling 4[E]★ Product Sum[E]★ Troubles[E]★ Squared Ends[E]Cyclist Race[E]★ Covered Walkway[E]Houses and Schools[E]★ Levels and Regions[E]★ Segment Add Get Min[E]Hit the Coconuts[E]Machine Works[M]★ The Fair Nut and Rectangles[M]Commando[M]Two Sawmills[M]Not Escaping[M]Uncle Bogdan and Projections[M]Cats Transport[M]Avoiding Airports[M]Jump mission[M]Pizza Delivery[M]Land Acquisition[M]Cow School[M]Good Inflation[M]Harbingers[M]Split the sequence[M]Lightning Conductor[M]Frogs[M]Cookie Clicker[M]Igloo Skyscraper[M]Cable Plan[M]Board Game[M]Bunnies[H]★ Escape Through Leaf[H]Polynomials[H]★ YATP[H]Weasel finds Staircase[H]Train Car Selection[H]Lena and Queries[H]Cycling (Hard Version)[H]Jaber and the Prediction Tree
8.4.2 Persistent CHT¶
- ID:
persistent_cht· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/persistent_cht
- Templates (1):
- Persistent CHT.cpp
- Resources (1):
- ★ Fully Persistent Convex Hull Trick By infinity
- Problems (3):
[M]★ Expert Computation[M]Harbingers[M]Giant Community
8.5 Li Chao Tree¶
Subcategory ID: li_chao_tree · Topics: 3
8.5.1 Li Chao Tree¶
- ID:
li_chao_tree· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/li_chao_tree
- Templates (1):
- Li Chao Tree.cpp
- Resources (4):
- ★ A Simple Introduction to Li-Chao Segment Tree | A Simple Blog
- ★ Convex hull trick and Li Chao tree | CP Algorithms
- A simpler way to understand Li-Chao tree By ngk_manh
- ★ [Tutorial] Li Chao Tree Extended 2 By tibinyte
- Problems (11):
[E]★ Segment Add Get Min[E]★ Kalila and Dimna in the Logging Industry[E]★ Frog 3[E]★ Squared Ends[E]Lines and Queries I[E]★ Lines and Queries II[E]Line Segments Trace I[E]★ Line Segments Trace II[M]Avoiding Airports[H]Polynomials[H]★ Escape Through Leaf
8.5.2 Persistent Li Chao Tree¶
- ID:
persistent_li_chao_tree· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/persistent_li_chao_tree
- Templates (1):
- Persistent Li Chao Tree.cpp
- Problems (3):
[M]Harbingers[M]★ Do you order queries?[M]Scrolls of Eternal Wisdom
8.5.3 Extended Li Chao tree¶
- ID:
extended_li_chao_tree· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/extended_li_chao_tree
- Templates (1):
- 86731
- Resources (1):
- ★ [Tutorial] Li Chao Tree Extended By rama_pang
- Problems (7):
[M]★ Progression[M]★ I hate Shortest Path Problem[M]Reazione a candela[H]★ Mall and Transportation[H]Train Car Selection[H]Mean Sequence[VH]Meetings
8.6 Bit Related DP¶
Subcategory ID: bit_related_dp · Topics: 6
8.6.1 Bitmask DP¶
- ID:
bitmask_dp· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/bitmask_dp
- Resources (10):
- ★ Bit manipulation | CP Algorithm
- Dynamic Programming and Bit Masking | HackerEarth
- ★ 10.5 Dynamic programming | CPH
- A Primer on Bitmask DP | Neo Wang
- [Tutorial] Non-trivial DP Tricks and Techniques By zscoder
- Introduction to DP with Bitmasking By kartik8800
- ★ A little bit of classics: dynamic programming over subsets and paths in graphs By Ripatti
- ★ Bitmask DP Problems [Slightly Harder Examples] | Gautam
- ★ Bitmask DP | USACO Guide
- ★ Traveling Salesman Problem | Dynamic Programming | Graph Theory WilliamFiset
- Problems (38):
[E]★ Matching[E]★ Hamiltonian Flights[E]★ Travelling Salesman Problem[E]★ A Simple Task[E]★ Team Building[E]Guard Mark[E]Moovie Mooving[E]★ Looking for Order[E]★ Maximum Independent Set[E]Shuffling Songs[E]Kefa and Dishes[M]★ Traveling Graph[M]★ Square Subsets[M]★ Fish[M]★ Grouping[M]★ Little Pony and Harmony Chest[M]Another Sith Tournament[M]Little Elephant and T-Shirts[M]Little Elephant and Alcohol[M]Histogram[M]★ Felicity's Big Secret Revealed[M]★ Sereja and GCD 2[M]Hasan and Points Pairing[M]★ Sherlock and Coprime Subset[M]Uddered but not Herd[M]Bank[M]Cat and Mice[M]Nuclear Fusion[M]Gym Plates[M]Maximum path[M]2048[M]★ Partition to K Equal Sum Subsets[H]★ Elevator Rides[H]★ Binary Table[H]Baby[H]★ Lights Off[VH]Professional layer[VH]★ Gold Experience
8.6.2 Sum Over Subsets DP (SOS DP)¶
- ID:
sos_dp· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/sos_dp
- Templates (1):
- SOS DP.cpp
- Resources (8):
- ★ Submask Enumeration | CP Algorithms
- ★ SOS Dynamic Programming [Tutorial] By usaxena95
- ★ Some SOS DP Insights By maxwellzen
- ★ SOS <> N Dimensional Prefix Sum | Errichto
- SOS <> N Dimensional Prefix Sum | Rezwan
- Sum over Subsets DP | USACO Guide
- The Big idea behind SOS DP ft. Editorial of 1995D : Cases Codeforces
- SOS DP | Vivek Gupta
- Problems (36):
[E]★ Bit Problem[E]★ Compatible Numbers[E]★ Vowels[E]★ And Subset Count[E]Covering Sets[E]★ Ordered Pairs[E]Problem Setting[E]★ Maximum And Queries (hard version)[M]Pepsi Cola[M]★ Close Group[M]★ Sandy and Nuts[M]★ Vim War[M]Beautiful Sandwich[M]★ Strange Functions[M]★ Good Pairs[M]Killing Monsters[M]Jersey Number[M]★ Cake Tasting[M]★ Good Permutations[M]Going Dutch[M]★ Prefix And[M]Love-Hate[M]★ Subsequences Galore[M]★ Bits And Pieces[M]Sleeping in Class[M]★ Time Limit Exceeded[M]★ Count Pairs[M]Pretests[M]Cases[H]★ Jzzhu and Numbers[H]★ Varying Kibibits[H]Danya and Numbers[H]★ Or Plus Max[H]Snake Escaping[H]★ Peculiar Partitioning II[VH]Wise Men (Hard Version)
8.6.3 [Problem] Subset Union of Bitsets¶
- ID:
subset_union_of_bitsets· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/subset_union_of_bitsets
- Templates (1):
- Subset Union of Bitsets.cpp
- Problems (1):
[E]★ Radio Radius
8.6.4 Subset Convolution¶
- ID:
subset_convolution· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/subset_convolution
- Templates (1):
- SOS convolutions.cpp
- Resources (5):
- ★ Tutorial on Zeta Transform, Mobius Transform and Subset Sum Convolution By sidhant
- Fourier Meets Mobius: Fast Subset Convolution | Andreas Bjorklund and Thore Husfeldt
- Subset convolution interpretation By adamant
- ★ OR Convolution for Common People By ko_osaga
- [Tutorial] Zeta, Mobius Transform to AND, OR, GCD Convolution By jinhan814
- Problems (2):
[M]★ Sum the Fibonacci[M]Friends and Pizza
8.6.5 [Trick] Dynamic Submask Count¶
- ID:
dynamic_submask_count· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/dynamic_submask_count
- Templates (1):
- 127469
- Resources (2):
- ★ Submask range queries By adamant
- Dynamic sum-over-subset dp with element addition and extraction in O(2^(k/2)) time By Peter-007
- Problems (3):
[E]★ Subset[M]★ Subset Sum[H]★ Longest beautiful sequence
8.6.6 [Problem] XOR Equation¶
- ID:
xor_equation· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/xor_equation
- Templates (1):
- XOR Equation.cpp
- Resources (1):
- ★ Editorial of Stone Game | kevinsogo
- Problems (3):
[M]★ Stone Game[M]★ Math teacher's homework[H]★ Innocence
8.7 More Tricks¶
Subcategory ID: more_tricks · Topics: 4
8.7.1 Open and Close Interval Trick¶
- ID:
open_and_close_interval_trick· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/open_and_close_interval_trick
- Resources (1):
- ★ [Tutorial] Non-trivial DP Tricks and Techniques By zscoder
- Problems (4):
[E]★ Group Projects[E]★ Coding Company[E]★ Increase Sequence[M]Sereja and Intervals
8.7.2 Slope Trick¶
- ID:
slope_trick· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/slope_trick
- Resources (6):
- ★ Slope trick explained By Kuroni
- ★ Slope Trick Visualised | benritmicocode
- ★ [Tutorial] Slope Trick By zscoder
- ★ Slope Trick | USACO Guide
- ★ [Tutorial] Intuition on Slope Trick By maomao9
- "Worse-to-best option", a different way to think about Slope Trick By gmyu.michael
- Problems (24):
[E]★ Sonya and Problem Wihtout a Legend[E]★ Increasing Array II[E]★ Buy Low Sell High[M]★ Fireworks[M]NarrowRectangles[M]★ Safety[M]Potatoes and fertilizers[M]Touch The Sky[M]Parklife[M]Farm Village[M]WAAAAAAAAAAAAALL[M]Bookface[M]★ Inc, Dec - Decomposition[M]★ Social Distancing[H]Honorable Mention[H]Landscaping[H]CCDSAP Exam[H]Magic Tree[H]Farm of Monsters[H]Paths[VH]Moving Walkways[VH]Mateusz and Escape Room[VH]Conquer The World[VH]April Fools' Problem (hard)
8.7.3 x2 +1 Trick¶
- ID:
x2_plus_1_trick· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/x2_plus_1_trick
- Templates (1):
- x2 +1 trick.cpp
- Resources (1):
- ★ [Tutorial] Non-trivial DP Tricks and Techniques By zscoder
- Problems (2):
[M]★ Perfect Permutations[H]★ Baby Ehab Plays with Permutations
8.7.4 Combining Subtrees Technique¶
- ID:
combining_subtrees_technique· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/combining_subtrees_technique
- Resources (5):
- ★ DP on Trees - Combining Subtrees | USACO Guide
- ★ Dp On Trees By AghaTizi
- ★ [Tutorial] Collection of little techniques By -is-this-fft-
- ★ Optimization for dp on tree needed. By negativez2
- Optimizing Round 595 Problem F from 𝑂(𝑛4) to 𝑂(𝑛) By neal
- Problems (13):
[E]★ Kth Subtree[E]★ Museum[M]Karen and Supermarket[M]Džumbus[M]Cereal Trees II[M]★ Maximum Weight Subset[M]Rivers[M]★ Tree Patrolling[M]★ Ostap and Tree[M]Miss Punyverse[M]★ Attack to a Tree[H]Periodni[H]★ Vladislav and a Great Legend
8.8 Classic DP¶
Subcategory ID: classic_dp · Topics: 3
8.8.1 Longest Increasing Subsequence (LIS)¶
- ID:
lis· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/lis
- Resources (2):
- ★ Longest increasing subsequence | CP Algorithms
- LIS in O(nlogn) with printing solution | Vivek Gupta
- Problems (28):
[E]★ Longest Increasing Subsequence[E]★ Increasing Subsequence[E]★ Flowers[E]★ Dosa[E]★ HowManyLis[E]★ One X LIS[E]Back to Edit Distance[E]Shortest and Longest LIS[E]LIS or Reverse LIS?[E]★ |LIS| = 3[E]Consecutive Subsequence[E]★ Increasing numbers[M]★ LISDL[M]LCIS[M]Tourist[M]★ North-East[M]Supernumbers in a permutation[M]Happy Birthday[M]★ Two LIS Sum[M]Tiling Up Blocks[M]★ LIS of Sequence[M]★ LIS on Tree[M]★ LIS vs. LDS[M]★ LIS on Tree 2[M]Alternating Sequences[M]★ Gather Coins[H]★ Binary Sort[VH]LIDS
8.8.2 Interval DP / Range DP / Matrix Chain Multiplication (MCM)¶
- ID:
mcm· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/mcm
- Resources (4):
- ★ Range DP | USACO Guide
- Matrix Chain Multiplication | DP-8 | Geeks for Geeks
- ★ Some Interval DP Problems and State Reduction By lelbaba
- Matrix Chain Multiplication using Dynamic Programming Formula - Abdul Bari
- Problems (23):
[E]★ Matrix-chain Multiplication[E]★ Mixtures[E]The Cow Run[E]248[E]Modern Art 3[M]★ Queries for Number of Palindromes[M]★ Slimes[M]Farmer John Solves 3SUM[M]★ Empty String[M]★ Zuma[M]Brackets[M]★ Array Shrinking[M]★ Erase Subsequences[M]★ Dreamoon and Strings[M]★ Kaavi and Magic Spell[M]★ Recovering BST[M]The Sports Festival[M]Paint Charges[M]Clear the String[M]Game With Triangles: Season 2[H]Greedy Pie Eaters[VH]Lights Out[VH]Paimon's Tree
8.8.3 Edit Distance¶
- ID:
edit_distance· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/edit_distance
- Resources (2):
- ★ Edit Distance | Geeks for Geeks
- Printing path in Edit Distance
- Problems (5):
[E]★ Edit Distance[E]Back to Edit Distance[E]★ Edit Distance[E]Levenshtein distance[M]Enchanted Artifact
8.9 Dp on Different Structures¶
Subcategory ID: dp_on_different_structures · Topics: 4
8.9.1 DP on Trees and DAGs¶
- ID:
dp_on_trees_and_dags· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/dp_on_trees_and_dags
- Resources (4):
- ★ DP on Trees Tutorial By darkshadows
- DP on Trees - Introduction | USACO Guide
- Dynamic Programming on Trees By kartik8800
- ★ Shortest/Longest path on a Directed Acyclic Graph (DAG) | Graph Theory WilliamFiset
- Problems (45):
[E]★ Distance in Tree[E]★ Longest Flight Route[E]★ Game Routes[E]Journey[E]★ Tree Diameter[E]★ Longest Path[E]★ Independent Set[E]★ Appleman and Tree[E]★ Tree Matching[E]Barn Painting[E]Choosing Capital for Treeland[E]The Fair Nut and the Best Path[E]Eternal Victory[E]★ Bakry and Partitioning[E]Sheriff's Defense[E]Tree Jumps[M]Non-Decreasing Colorful Path[M]Mahmoud and a xor trip[M]★ Anton and Tree[M]★ Coin Collector[M]★ Ralph and Mushrooms[M]★ Subtree[M]Binary Apple Tree[M]Tree Pruning[M]Anniversary Party[M]Berland Federalization[M]Village (Minimum)[M]★ Nastia Plays with a Tree[M]Parade[M]★ Parsa's Humongous Tree[M]★ Select Edges[M]Delegation[M]Tree XOR[M]Weight the Tree[M]Vasya and Maximum Matching[M]Protection[H]Yet Another DAG Problem[H]Spies[H]Mafia[H]★ Boboniu and Jianghu[H]Alkane[VH]Torrent[VH]Training[VH]★ Creating Offices[VH]Swap
8.9.2 DP over Divisors¶
- ID:
dp_over_divisors· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/dp_over_divisors
- Templates (1):
- DP Over Divisors.cpp
- Resources (1):
- [Tutorial] Zeta, Mobius Transform to AND, OR, GCD Convolution By jinhan814
- Problems (3):
[E]Small GCD[H]★ Maximum GCD Sum Queries[H]★ Discrete Logarithm Problems
8.9.3 Substring DP¶
- ID:
substring_dp· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/substring_dp
- Templates (1):
- Prefix Automaton.cpp
- Resources (1):
- Prefix function. Knuth–Morris–Pratt algorithm | CP Algorithms
- Problems (9):
[M]★ Required Substring[M]★ Bracket Substring[M]★ Anthem of Berland[M]★ Lucky Common Subsequence[M]★ Unlucky Strings[M]★ Remove The String[M]Phone Numbers[M]★ Nitu and Her Lucky String[M]substr = S
8.9.4 DP on Convex Hulls¶
- ID:
dp_on_convex_hulls· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/dp_on_convex_hulls
- Templates (1):
- DP on Convex Hulls.cpp
- Resources (2):
- ★ Transition Then State | mzhang2021
- A bit more of general ideas By adamant
- Problems (6):
[E]★ Cold Rainy Night in Stoke[M]★ Profitable Home[M]★ Integer Convex Hull[M]Security at Museums[M]Pegs[M]★ ConvexScore
8.10 Miscellaneous¶
Subcategory ID: miscellaneous · Topics: 5
8.10.1 Connected Component DP¶
- ID:
connected_component_dp· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/connected_component_dp
- Templates (1):
- Connected Component DP.cpp
- Resources (3):
- [Tutorial] Dp with connected components, a simple way to understand it. By humbertoyusta
- ★ [Tutorial] Non-trivial DP Tricks and Techniques By zscoder
- Do you really understand Connected Components DP? By TheScrasse,
- Problems (12):
[E]★ Permutations II[M]★ Skyscraper[M]Kangaroo[M]Ant Man[M]Phoenix and Computers[M]★ Network[M]April Fools[M]Mentors[M]Magical Teleporter (Subtask 4)[M]Reading Novels[M]★ Zero-Sum Ranges 2[H]★ Route Defense
8.10.2 Broken Profile DP / Plug DP¶
- ID:
broken_profile_dp· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/broken_profile_dp
- Resources (5):
- ★ An Introduction to Plug DP By 4fecta
- DP on broken profile by Pavel Mavrin
- ★ DP on Broken Profile | USACO Guide
- 插头 DP | Oi Wiki
- Broken profile dynamic programming | EvilBuggy
- Problems (4):
[E]★ Counting Tilings[M]Guards In The Storehouse[M]Connect[VH]Compound Escape
8.10.3 Hirschberg's Algorithm¶
- ID:
hirschbergs_algorithm· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/hirschbergs_algorithm
- Templates (1):
- 57512
- Resources (1):
- Hirschberg's Algorithm By KokiYmgch
- Problems (1):
[E]★ Classic Task
8.10.4 [Problem] Number of Subsequences Having Product at least K¶
- ID:
number_of_subsequences_having_product_at_least_k· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/number_of_subsequences_having_product_at_least_k
- Templates (1):
- Number of Subsequences Having Product at least K.cpp
- Resources (1):
- A comment by neutron-byte
- Problems (1):
[E]★ Подарок
8.10.5 [Problem] Range LIS Query¶
- ID:
lis_range_query· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/lis_range_query
- Resources (3):
- ★ [Tutorial] On Range LIS Queries, Part 1 By ko_osaga
- ★ [Tutorial] On Range LIS Queries, Part 2 By ko_osaga
- Range query to find Longest Increasing Subsequence Please Help By vivace1
- Problems (5):
[E]★ Sereja and Increasing subsequence[E]★ Static Range LIS Query[E]Product of Unit Monge Matrices[M]Form the Maximal Set[M]싱싱미역
9. Game Theory¶
Category ID: game_theory · Subcategories: 4 · Topics: 7
9.1 Grundy Number / Nim¶
Subcategory ID: grundy_number · Topics: 2
9.1.1 Grundy Number and Basic Game Theory¶
- ID:
grundy_number· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/grundy_number
- Resources (6):
- ★ Sprague-Grundy theorem. Nim | CP Algorithms
- ★ Sprague-Grundy theorem | e-maxx
- ★ The Intuition Behind NIM and Grundy Numbers in Combinatorial Game Theory By Shisuko
- ALGORITHM GAMES | Topcoder
- Grundy numbers for competitive programming | Let us code
- Game Theory | Arabic tutorial
- Problems (45):
[E]★ Day 1: Game of Stones[E]Day 1: Tower Breakers[E]Day 1: A Chessboard Game[E]★ Stick Game[E]★ Day 2: Nim Game[E]★ Nim Game I[E]★ Day 2: Misère Nim[E]★ Nim Game II[E]S-Nim[E]★ Day 2: Nimble Game[E]Day 2: Poker Nim[E]★ Everything Nim[E]★ Day 2: Tower Breakers, Revisited![M]Day 3: Tower Breakers, Again![M]★ Day 3: Chessboard Game, Again![M]★ Day 3: Digits Square Board[M]Day 4: Fun Game[M]★ Day 4: Powers Game[M]Day 5: Tower Breakers - The Final Battle[M]★ Stair Game[M]★ Grundy's Game[M]★ Temporal Paradox[M]Floor Division Game[M]★ Another Game[M]★ Playing With Stones[M]★ Playing with String[M]Arbitrary Nim[M]Cuboid Slicing Game[M]Marbles[M]Matrix Game[M]Pawn Game[M]★ IBM Chill Zone[M]★ Sagheer and Apple Tree[M]★ Game of Stones[M]★ Arpa and a game with Mojtaba[M]Interval Game 2[M]★ A String Game[M]★ Not a Nim Problem[M]Bono v3[M]Hagras Game[H]★ Strange Nim[H]Attack on Red Kingdom[H]Nullify The Matrix[H]Peanuts[H]Nim
9.1.2 Nimber¶
- ID:
nimber· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/nimber
- Resources (1):
- ★ Nimbers and Sprague-Grundy theorem By adamant
- Problems (2):
[E]★ Nim Product[H]★ Bad Cryptography
9.2 Hackenbush¶
Subcategory ID: hackenbush · Topics: 2
9.2.1 Green Hackenbush on Trees and Graphs¶
- ID:
green_hackenbush_on_trees_and_graphs· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/green_hackenbush_on_trees_and_graphs
- Templates (1):
- Green Hackenbush.cpp
- Resources (3):
- Hackenbush | Wiki
- green-hackenbush-ww.pdf
- 2.6 Analysis of Green Hackenbush
- Problems (6):
[E]★ Day 5: Deforestation[E]★ Game on Tree[E]Play with a Tree[E]Bob vs ATM[M]Game of CS[M]Game of CS
9.2.2 Blue Red HackenBush¶
- ID:
blue_red_hackenbush· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/blue_red_hackenbush
- Templates (1):
- Blue Red Hackenbush.cpp
- Resources (3):
- ★ 3.1 Analysis of Blue-Red Hackenbush
- ★ GERALD08 - Editorial
- ★ Red-Blue Hackenbush and Surreal Numbers | Tom Davis
- Problems (1):
[M]★ Chef and Tree Game
9.3 Graph Games¶
Subcategory ID: graph_games · Topics: 2
9.3.1 Games on Arbitrary Graphs¶
- ID:
games_on_arbitrary_graphs· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/games_on_arbitrary_graphs
- Resources (1):
- ★ Games on arbitrary graphs | CP Algorithms
- Problems (1):
[M]Cat and Mouse
9.3.2 [Problem] Matching Game On A Graph¶
- ID:
matching_game_on_a_graph· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/matching_game_on_a_graph
- Templates (1):
- Matching Game On A Graph.cpp
- Resources (1):
- ★ HAMILG - Editorial
- Problems (1):
[M]★ A game on a graph
9.4 Miscellaneous¶
Subcategory ID: miscellaneous · Topics: 1
9.4.1 Alpha Beta Pruning¶
- ID:
alpha_beta_pruning· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/alpha_beta_pruning
- Templates (1):
- Alpha Beta Pruning.cpp
- Resources (2):
- ★ Minimax Algorithm in Game Theory | Set 4 | Geeks for Geeks
- Alpha Beta Pruning Simulator
- Problems (1):
[M]★ Some Game
10. Geometry¶
Category ID: geometry · Subcategories: 10 · Topics: 55
10.1 Euclidean Geometry¶
Subcategory ID: euclidean_geometry · Topics: 1
10.1.1 Euclidean Geometry¶
- ID:
euclidean_geometry· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/euclidean_geometry
- Problems (45):
[E]★ Egypt[E]The Lazy Lumberjacks[E]10:6:2[E]★ Circle in Square[E]★ Behold my quadrangle[E]Satellites[E]Points in Figures: Rectangles[E]Points in Figures: Rectangles and Circles[E]Soya Milk[E]★ Triangle Trouble[E]★ Triangle Partitioning[E]★ Crossed Ladders[E]★ Three Circle Problem (EASY)[E]Graveyard[E]Is this the easiest problem?[E]★ Medians[E]Trapezium[E]The Knights Of The Round Table[E]★ How Cow[E]Area of a Parallelogram[E]★ Juice in the Glass[E]★ Universal Radius[E]★ Calm Down[E]Olympics[E]★ Circle of Polygon[M]★ Region[M]★ The Kissing Circles[M]★ Polygon Inside A Circle[M]★ Agent J[M]★ Minimum Arc Distance[M]★ How Far?[M]Gifts in a Hexagonal Box[M]★ Weird Cake[M]★ I Scream, You Scream![M]Hexagonal Packing[M]★ Parallelogram Counting[M]Expanding Rods[M]★ Intersection of Cubes[M]★ Kingdom Division[M]Overtake[M]★ Counting Rectangles[M]★ Pair of Touching Circles[M]★ THE MAX LINES[H]Trapezium Drawing[H]★ Triangle Inside Rectangle Inside Pentagon
10.2 Geometry 2D¶
Subcategory ID: geo_2d · Topics: 24
10.2.1 Points, Vectors, Transformations, Dot Products, Cross Products, Precision Issues and Polar Sort(2D)¶
- ID:
points_and_vectors_2d· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/points_and_vectors_2d
- Templates (1):
- Geometry 2D.cpp#L4-L73
- Resources (6):
- ★ Chapter 1 Precision issues and epsilons, Chapter 2.1 Points and vectors, 2.2 Transformations and 2.3 Products and angles | CP Geo
- Basic Geometry | CP Algorithms
- Geometry: 2D points and lines [Tutorial] By Al.Cash
- Basic Geometry for Competitive Programming | Geeks for Geeks
- ★ Easy geometry using std::complex By Hikari9
- Geometry Russian Contest Problems Translation
- Problems (18):
[E]★ Point Location Test[E]★ Length of vector[E]Fourth Point![E]★ Bright Lights[E]★ Polar angle of point[E]★ Angle between vectors[E]★ Once Upon A Time In Child Hood[E]★ Sort Points by Argument[E]Sunny Mountains[E]Simple[M]A Chase In WonderLand[M]Underwater Snipers[M]★ Angle Beats[M]★ Disjoint Triangles[M]★ Maximum Number of Colinear Points[M]Sofdor Ali and Attack Optimization[M]★ Closest Distance[H]★ Count Points in Triangles
10.2.2 Lines, Segments, Rays, Distance and Relation Between Two Structures, Projections and Reflections(2D)¶
- ID:
lines_and_segments_2d· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/lines_and_segments_2d
- Templates (1):
- Geometry 2D.cpp#L74-L269
- Resources (7):
- ★ Chapter 2.4 Lines and 2.5 Segments | CP Geo
- Finding the equation of a line for a segment | CP Algorithms
- ★ Intersection Point of Lines | CP Algorithms
- Check if two segments intersect | CP Algorithms
- ★ Finding intersection of two segments | CP Algorithms
- Geometry: 2D points and lines [Tutorial] By Al.Cash
- Geometry Russian Contest Problems Translation
- Problems (39):
[E]★ Distance from a point to a straight line[E]★ Bisector[E]★ Distance from point to line[E]★ Distance from point to line 2[E]★ Distance from a point to a ray[E]★ The equation of the straight line I[E]★ The equation of the straight line II[E]★ Parallel line[E]★ Distance between segments[E]★ Intersection of two lines[E]★ Belonging to a point of straight line[E]★ Belonging of a point to a segment[E]★ Belonging to the point of the ray[E]The position of the points outside the line[E]★ Line Segment Intersection[E]★ Line Segment Intersection[E]★ Line Segment Distance[E]An Angular Puzzle[E]★ Intersection[E]★ Intersecting Lines[E]★ Isolated Segments[E]Pick-up Sticks[E]★ Berry Picking[E]★ The Ant[E]Birthday Cake[E]★ LFR[M]★ Distance between rays[M]Mysterious Mountain[M]GX Light Pipeline Inc[M]Boris, You Are Wrong![M]★ Overlapping Sticks[M]★ Rectangle Division[M]★ Alien Invasion[M]★ Laser Shot[M]★ Parallel Lines[H]★ Race Track[H]★ Farmers' Tale[H]★ Aladdin and the Rocky Mountains[VH]★ Minimize the Distance
10.2.3 Circles, Circle Relations, Intersections, Inscribed Circles and Circumcircles(2D)¶
- ID:
circles_2d· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/circles_2d
- Templates (2):
- Geometry 2D.cpp#L270-L363
- Geometry 2D.cpp#L410-L419
- Resources (3):
- ★ Chapter 2.7 Circles (excluding 2.7.5 Tangent lines) | CP Geo
- ★ Circle-Line Intersection | CP Algorithms
- Circle-Circle Intersection | CP Algorithms
- Problems (17):
[E]★ The Circumference of the Circle[E]★ Circle Through Three Points[E]★ Colourful Flowers[E]★ A New Door[E]★ Intersecting Circles[E]★ Incredible Molecules[E]Air Strike[E]★ Two Circles[E]Circle of Boltu[M]Rings and Glue[M]Runaway to a Shadow[M]Get Out![M]Biscuits[M]★ Pair of Touching Circles[H]★ A Colourful Prospect[H]★ LL’s cake[H]★ The Falling Circle
10.2.4 Tangents(2D)¶
- ID:
tangent_2d· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/tangent_2d
- Templates (2):
- Geometry 2D.cpp#L420-L454
- Geometry 2D.cpp#L364-L391
- Resources (2):
- ★ Chapter 2.7.5 Tangent lines | CP Geo
- ★ Finding common tangents to two circles | CP Algorithms
- Problems (2):
[M]★ 2D Geometry 110 in 1![M]Chapaev
10.2.5 Circles of Apollonius(2D)¶
- ID:
circles_of_apollonius_2d· Difficulty: Easy · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/circles_of_apollonius_2d
- Templates (1):
- Geometry 2D.cpp#L392-L409
- Resources (1):
- ★ Circles of Apollonius | Wiki
- Problems (1):
[M]★ Commentator problem
10.2.6 Circle Union(2D)¶
- ID:
circle_union_2d· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/circle_union_2d
- Templates (1):
- Geometry 2D.cpp#L455-L554
- Resources (1):
- Area of union of circles discussion
- Problems (3):
[E]★ Area of circles[H]★ The area of the union of circles[H]★ Cleaning the Hallway
10.2.7 Polygons(2D)¶
- ID:
polygons_2d· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/polygons_2d
- Templates (1):
- Geometry 2D.cpp#L555-L577
- Resources (3):
- ★ Chapter 2.6.1 Polygon area and 2.6.2 Cutting-ray test | CP Geo
- ★ Oriented area of a triangle | CP Algorithms
- ★ Finding area of simple polygon | CP Algorithms
- Problems (9):
[E]★ Polygon Area[E]★ Polygon Area[E]Smallest Regular Polygon[E]Points in Figures: Rectangles, Circles, Triangles[E]Determine the Shape[E]★ Divorce[E]★ Drawing Simple Polygon[M]★ Piece of Cake[H]Chef and Polygons
10.2.8 Centroid of a Polygon(2D)¶
- ID:
centroid_of_a_polygon_2d· Difficulty: Easy · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/centroid_of_a_polygon_2d
- Templates (1):
- Geometry 2D.cpp#L578-L592
- Resources (1):
- Centroid | Wiki
- Problems (2):
[E]Lifting the Stone[M]★ Crane Balancing
10.2.9 Geometric Median(2D)¶
- ID:
geometric_median_2d· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/geometric_median_2d
- Templates (1):
- Geometry 2D.cpp#L600-L632
- Resources (2):
- Geometric median | Wiki
- On finding geometric median with ternary searches By shortHorse
- Problems (1):
[E]★ A Star not a Tree?
10.2.10 Convex Hull(2D)¶
- ID:
convex_hull_2d· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/convex_hull_2d
- Templates (1):
- Geometry 2D.cpp#L633-L669
- Resources (3):
- ★ Convex Hull construction | CP Algorithms
- ★ Convex Hull | USACO Guide
- ★ Number of points on Convex hull with lattice points By Anachor
- Problems (22):
[E]★ Convex Hull[E]Convex Hull[E]★ Static Convex Hull[E]★ Guarding Bananas[E]SCUD Busters[E]Useless Tile Packers[E]Palindromic Polygon[E]★ Triangle Trap[M]★ Convex Fence[M]★ Darts[M]★ Kingdom Division 2[M]★ Wall[M]Keep the Parade Safe[M]★ U2[M]Cow Curling[M]★ Triangle[M]★ Water Balance[M]★ CONSEPHULL[H]★ Towers of Wadia[H]★ Chop Chop[H]★ Protect the Mines[H]Kingdom Of Kittens
10.2.11 Point in Convex Polygon in log(N)(2D)¶
- ID:
check_if_point_is_in_convex_2d· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/check_if_point_is_in_convex_2d
- Templates (1):
- Geometry 2D.cpp#L670-L687
- Resources (2):
- ★ Check if point belongs to the convex polygon | CP Algorithms
- 4.1 Triangle: O(1) and 4.2 Convex polygon: O(logN)
- Problems (5):
[E]★ Polygon and Points[E]★ Polygons[E]★ Theodore Roosevelt[M]Very simple problem[M]★ Mogohu-Rea Idol
10.2.12 Winding Number and Point in Simple Polygon(2D)¶
- ID:
winding_number_2d· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/winding_number_2d
- Templates (1):
- Geometry 2D.cpp#L688-L714
- Resources (3):
- Winding number | Wiki
- Point in polygon | Wiki
- ★ 4.3 Simple polygon: O(N)
- Problems (3):
[E]★ Winding Number[E]Point in Polygon[E]Point in Polygon
10.2.13 Extreme Vertex(2D)¶
- ID:
extreme_vertex_2d· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/extreme_vertex_2d
- Templates (1):
- Geometry 2D.cpp#L715-L740
- Resources (1):
- ★ 5. Extreme points
10.2.14 Rotating Calipers ft Diameter and Width of a Convex Polygon and Minimum Enclosing Rectangle(2D)¶
- ID:
rotating_calipers· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/rotating_calipers
- Templates (1):
- Geometry 2D.cpp#L741-L794
- Resources (5):
- Rotating calipers| Wiki
- ★ COMPUTATIONAL GEOMETRY WITH THE ROTATING CALIPERS by Hormoz Pirzadeh
- ★ [Tutorial] Rotating calipers technique and its applications By asdasdqwer
- Solving Geometric Problems with the Rotating Calipers | Godfried Toussaint
- Finding the Diameter of a Polygon using Two pointers and Monotone Chain By chromate00
- Problems (12):
[E]★ Robert Hood[E]★ All-Pair Farthest Points[E]★ Furthest Pair of Points[E]★ Trash Removal[E]★ Fossil in the Ice[E]★ Fence Orthogonality[E]Largest Triangle[E]★ Smallest Enclosing Rectangle[E]★ Smallest Bounding Rectangle[E]★ Blowing Candles[M]★ Triangle[M]★ Bridge Across Islands
10.2.15 Minimum Enclosing Circle(2D)¶
- ID:
minimum_enclosing_circle_2d· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/minimum_enclosing_circle_2d
- Templates (1):
- Geometry 2D.cpp#L795-L818
- Resources (6):
- ★ Smallest-circle problem | Wiki
- ★ Minimum enclosing circle using Welzl’s algorithm | Geeks for Geeks
- ★ Commented out code about Welzl's Algorithm
- ★ Smallest Enclosing Circle Slides
- How to find the minimum enclosing circle of a set of points ZeroKelvinTutorials
- ★ Simple approach of Smallest Circle problem: Hill Climbing Tozan Southerpacks Redcoder
- Problems (6):
[E]★ Enclose All[E]★ Minimum Diameter Circle[E]Aliens[E]★ Rise of the Robots[E]Weird Flecks, But OK[M]N-Ta-Gon Has a Problem
10.2.16 Polygon Line and Convex Line Intersection, and Polygon Cutting(2D)¶
- ID:
polygon_line_intersection_2d· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/polygon_line_intersection_2d
- Templates (1):
- Geometry 2D.cpp#L819-L896
- Resources (2):
- ★ 6. Polygon stabbing
- ★ Intersection between a convex polygon and a line
- Problems (3):
[E]★ Cut Length[M]★ Airport Construction[H]★ Freestyle
10.2.17 Tangents from Point to Convex and Convex to Convex(2D)¶
- ID:
tangents_from_point_to_polygon_2d· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/tangents_from_point_to_polygon_2d
- Templates (1):
- Geometry 2D.cpp#L897-L930
- Resources (6):
- ★ 5.1 Convex polygon: O(logN)
- ★ Upper and lower tangent line to convex hull from a point
- 09 Convex Hulls - Common tangent from a point | peyman afshani
- 10 Convex Hulls - Common tangent between two hulls peyman afshani
- Tangents between two Convex Polygons | Geeks for Geeks
- Help for a Geometry Problem By _Ash__
- Problems (4):
[E]★ Cover the Points[H]★ Circular Island[H]★ Enclosure[H]Spaceship Exploration
10.2.18 Distance from Point to Convex, Convex to Line and Convex to Convex(2D)¶
- ID:
dist_from_point_to_polygon_2d· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/dist_from_point_to_polygon_2d
- Templates (1):
- Geometry 2D.cpp#L932-L977
- Resources (2):
- COMPUTATIONAL GEOMETRY WITH THE ROTATING CALIPERS by Hormoz Pirzadeh
- [Tutorial] Distance of two convex polygon By FHVirus
- Problems (1):
[M]★ Bridge Across Islands
10.2.19 Maximum Distance from Convex to Convex(2D)¶
- ID:
maximum_dist_from_polygon_to_polygon_2d· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/maximum_dist_from_polygon_to_polygon_2d
- Templates (1):
- Geometry 2D.cpp#L978-L997
- Resources (1):
- COMPUTATIONAL GEOMETRY WITH THE ROTATING CALIPERS by Hormoz Pirzadeh
10.2.20 Polygon Union(2D)¶
- ID:
polygon_union_2d· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/polygon_union_2d
- Templates (1):
- Geometry 2D.cpp#L999-L1044
- Problems (1):
[E]★ Darts
10.2.21 Polygon Triangulation(2D)¶
- ID:
triangulation_2d· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/triangulation_2d
- Templates (1):
- Geometry 2D.cpp#L1244-L1270
- Resources (3):
- ★ Polygon triangulation | Wiki
- Every Polygon can be Triangulated Into Exactly n-2 Triangles | Proof by Induction | Think Twice
- ★ Polygon Triangulation [1] - Overview of Ear Clipping | Two-Bit Coding
- Problems (2):
[M]Back To The Polygon[H]★ Gears
10.2.22 Maximum Circle Cover(2D)¶
- ID:
maximum_circle_cover_2d· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/maximum_circle_cover_2d
- Templates (1):
- Geometry 2D.cpp#L1178-L1218
- Resources (1):
- What is an algorithm for enclosing the maximum number of points in a 2-D plane with a fixed-radius circle? | Quora
- Problems (3):
[E]★ Circle and Points[M]★ WiFi Expenses[M]★ Chef and Circle
10.2.23 Maximum Inscribed Circle in a Convex(2D)¶
- ID:
maximum_inscribed_circle_2d· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/maximum_inscribed_circle_2d
- Templates (1):
- Geometry 2D.cpp#L1219-L1243
- Problems (2):
[E]Most Distant Point from the Sea[E]제주도
10.2.24 Triangle Circle and Polygon Circle Intersection(2D)¶
- ID:
polygon_circle_intersection_2d· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/polygon_circle_intersection_2d
- Templates (1):
- Geometry 2D.cpp#L1130-L1177
- Problems (6):
[E]★ Intersection between Circle and Rectangle[E]★ Fukushima Nuclear Blast[E]★ Pollution Solution[H]★ Area of an amazing figure[H]★ Gears[H]Cover the Polygon with Your Disk
10.3 Geometry 3D¶
Subcategory ID: geo_3d · Topics: 9
10.3.1 Points, Vectors, Dot Products, Cross Products and Mixed Products(3D)¶
- ID:
points_and_vectors_3d· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/points_and_vectors_3d
- Templates (1):
- Geometry 3D.cpp#L1-L95
- Resources (1):
- ★ Chapter 3.1 Points, products and orientation | CP Geo
- Problems (2):
[E]★ Triangle[E]★ How I Wonder What You Are!
10.3.2 Planes(3D)¶
- ID:
planes_3d· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/planes_3d
- Templates (1):
- Geometry 3D.cpp#L97-L129
- Resources (1):
- ★ Chapter 3.2 Planes (excluding 3.2.5) | CP Geo
- Problems (1):
[M]★ Composite Transformations
10.3.3 Plane Based Coordinate System(3D)¶
- ID:
plane_based_coordinate_system_3d· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/plane_based_coordinate_system_3d
- Templates (1):
- Geometry 3D.cpp#L131-L161
- Resources (1):
- ★ Chapter 3.2.5 Coordinate system based on a plane | CP Geo
- Problems (2):
[H]★ Bikpik Colony[H]★ Stars in a Can
10.3.4 Lines, Segments, and Distances, Angles and Intersections Between Lines and Planes(3D)¶
- ID:
lines_3d· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/lines_3d
- Templates (1):
- Geometry 3D.cpp#L163-L258
- Resources (2):
- ★ Chapter 3.3 Lines | CP Geo
- ★ Chapter 3.4 Angles between planes and lines | CP Geo
- Problems (4):
[E]★ Ardenia[M]The Deadly Olympic Returns!!![M]★ Star War[H]★ Entangled Circles
10.3.5 Triangles and Distance from Triangle to Triangle(3D)¶
- ID:
distance_from_triangle_to_triangle_3d· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/distance_from_triangle_to_triangle_3d
- Templates (1):
- Geometry 3D.cpp#L259-L304
- Resources (1):
- ★ A comment by ko_osaga
- Problems (3):
[E]★ Triangles[E]★ 3D Triangles[H]Paperweight
10.3.6 Spherical Geometry and Winding Number(3D)¶
- ID:
spheres_3d· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/spheres_3d
- Templates (2):
- Geometry 3D.cpp#L548-L746
- Geometry 3D.cpp#L768-L776
- Resources (1):
- ★ 3.6 Spherical geometry | CP Geo
- Problems (3):
[M]★ Der Stern[M]★ Bermuda Polygon[M]★ Cutting Cheese
10.3.7 Minimum Enclosing Sphere(3D)¶
- ID:
minimum_enclosing_sphere_3d· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/minimum_enclosing_sphere_3d
- Templates (1):
- Geometry 3D.cpp#L748-L766
- Resources (2):
- ★ Simple approach of Smallest Circle problem: Hill Climbing Tozan Southerpacks Redcoder
- ★ Smallest Enclosing Circle/Sphere Problem By hongjun-7
- Problems (2):
[E]★ Space Rescuers[E]★ Minimizing Sphere
10.3.8 Polyhedron, Pyramid, Cone and Cylinder(3D)¶
- ID:
polyhedron_3d· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/polyhedron_3d
- Templates (2):
- Geometry 3D.cpp#L307-L365
- Geometry 3D.cpp#L779-L825
- Resources (1):
- ★ Chapter 3.5 Polyhedrons | CP Geo
- Problems (3):
[E]Pyramid[M]Weapon[VH]Tetrahedrons and Spheres
10.3.9 Convex Hull(3D)¶
- ID:
convex_hull_3d· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/convex_hull_3d
- Templates (1):
- Geometry 3D.cpp#L367-L546
- Resources (1):
- ★ Efficient 3D Convex Hull Tutorial By Monogon
- Problems (5):
[E]★ 3D Convex Hull[E]Convex Hull 3D[E]Ultimate Weapon[M]★ Asteroids[H]★ Stars in a Can
10.4 Delaunay¶
Subcategory ID: delaunay · Topics: 1
10.4.1 Delaunay Triangulation and Voronoi Diagram¶
- ID:
delaunay_triangulation· Difficulty: Very Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/delaunay_triangulation
- Templates (2):
- Delaunay Triangulation.cpp
- Voronoi Diagram.cpp
- Resources (4):
- ★ [Tutorial] Voronoi Diagram and Delaunay Triangulation in O(n log n) with Fortune's Algorithm By Monogon
- Delaunay triangulation | Wiki
- Voronoi diagram | Wiki
- ★ Delaunay triangulation and Voronoi diagram | CP Algorithms
- Problems (5):
[E]★ Landing[M]Caravans[M]Good Manners[M]Empire Strikes Back[H]★ Panda Preserve
10.5 Half Plane¶
Subcategory ID: half_plane · Topics: 2
10.5.1 Half Plane Intersection¶
- ID:
half_plane_intersection· Difficulty: Hard · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/half_plane_intersection
- Templates (1):
- Half Plane Intersection.cpp
- Resources (2):
- ★ Half-plane intersection | CP Algorithms
- ★ Blogewoosh #5 (with images from now) By Radewoosh
- Problems (20):
[E]★ Video Surveillance[E]★ Polygons Intersection[E]★ Defend the Recipe[E]★ Uyuw's Concert[E]Animesh decides to settle down[E]Rotating Scoreboard[E]How I Mathematician Wonder What You Are![E]Art Gallery[E]Polygons[E]Domes[E]Most Distant Point from the Sea[E]제주도[M]★ The Perfect Spider Web[M]Feng Shui[M]★ Ax + By < C[M]Health in Hazard[H]Triathlon[H]Arrow[H]Jungle Outpost[VH](Almost) Fair Cake-Cutting
10.5.2 Dynamic Half Plane Intersection¶
- ID:
dynamic_half_plane_intersection· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/dynamic_half_plane_intersection
- Templates (1):
- Half Plane Intersection Dynamic.cpp
- Problems (1):
[E]★ Defend the Recipe
10.6 Convex Polygon¶
Subcategory ID: convex_polygon · Topics: 3
10.6.1 Minkowski Sum¶
- ID:
minkowski_sum· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/minkowski_sum
- Templates (1):
- Geometry 2D.cpp#L1103-L1129
- Resources (3):
- ★ Minkowski sum of convex polygons | CP Algorithms
- ★ [Tutorial] Distance of two convex polygon By FHVirus
- [Solved] A problem related to: minkowski sum of two simple polygon By steinum
- Problems (8):
[E]Bridge Across Islands[M]★ Mogohu-Rea Idol[M]★ Geometers Anonymous Club[M]★ Non-Flying Weather[M]★ CONSEPHULL[M]★ Rotation Dilemma[M]★ Gravitational Wave Detector[H]★ Gears
10.6.2 Dynamic Convex Hull¶
- ID:
dynamic_convex_hull· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/dynamic_convex_hull
- Templates (1):
- Convex Hull Dynamic.cpp
- Resources (1):
- ★ Tiny Dynamic Convex Hull Implementation By brunomont
10.6.3 Onion Decomposition¶
- ID:
onion_decomposition· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/onion_decomposition
- Templates (1):
- Onion Decomposition.cpp
- Resources (1):
- Dynamic convex hull implementation By dragonslayerintraining
- Problems (3):
[E]★ Convex Layers[M]Winding polygonal line[H]Bubble Popping
10.7 Lattice Points¶
Subcategory ID: lattice_points · Topics: 2
10.7.1 Picks Theorem¶
- ID:
picks_theorem· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/picks_theorem
- Resources (2):
- Pick's Theorem | CP Algorithms
- Pick’s Theorem | Tom Davis
- Problems (3):
[E]★ Polygon Lattice Points[E]★ Trees on My Island[M]★ Find C
10.7.2 Lattice Points inside a Non-Lattice Polygon¶
- ID:
lattice_points_inside_a_non_lattice_polygon· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/lattice_points_inside_a_non_lattice_polygon
- Resources (1):
- ★ Lattice points inside non-lattice polygon | CP Algorithms
10.8 Sweep Line¶
Subcategory ID: sweep_line · Topics: 5
10.8.1 Sweep Line Algorithm and Radial Sweep¶
- ID:
sweep_line_algorithm· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/sweep_line_algorithm
- Resources (4):
- ★ How to sweep like a Sir By DanAlex
- LINE SWEEP ALGORITHMS | Topcoder
- ★ Chapter 30 Sweep line algorithms | CPH
- ★ Sweep Line | USACO Guide
- Problems (23):
[E]★ Rectangles[E]★ Intersection Points[E]★ Closest Pair[E]Circuits[E]Square Overlap[E]Balloon[E]★ Grid MST[E]Jigsaw of Shadows[M]★ Birthday Cake[M]Cow Steeplechase II[M]Hill Walk[M]★ Seeing the Boundary[M]★ Pionek[M]Hide and seek[M]★ Oil[M]★ WiFi Expenses[M]★ Chef and Circle[H]Plahte[H]Walk[H]Signaling[H]★ Cleaning the Hallway[VH]★ Roads[VH]Global Warming
10.8.2 Closest Pair of Points¶
- ID:
closest_pair_of_points· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/closest_pair_of_points
- Templates (1):
- Closest Pair of Points.cpp
- Resources (3):
- ★ Finding the nearest pair of points | CP Algorithms
- ★ A (possibly simpler) algorithm for closest pair problem By bicsi
- Closest Pair of Points using Divide and Conquer algorithm | Geeks for Geeks
- Problems (7):
[E]★ Minimum Euclidean Distance[E]★ Closest Pair of Points[E]The Closest Pair Problem[E]★ Closest Pair[M]Minimum Sum[M]★ Closest Triplet[M]National Park
10.8.3 Rectangle Union¶
- ID:
rectangle_union· Difficulty: Easy · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/rectangle_union
- Templates (1):
- Rectangle Union.cpp
- Resources (2):
- ★ How to sweep like a Sir By DanAlex
- Rectangle Union Problem By P_Nyagolov
- Problems (4):
[E]★ Area of Rectangles[E]★ Area of Union of Rectangles[E]★ Rectangles[E]★ Kingdom of Ants
10.8.4 All Pair Segment Intersection.¶
- ID:
all_pair_segment_intersection· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/all_pair_segment_intersection
- Templates (1):
- All Pair Segment Intersection.cpp
- Resources (1):
- ★ Search for a pair of intersecting segments | CP Algorithms
- Problems (2):
[M]★ RC Kaboom Show[M]★ No Smoking!
10.8.5 Vertical decomposition¶
- ID:
vertical_decomposition· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/vertical_decomposition
- Resources (1):
- Vertical decomposition | CP Algorithms
- Problems (2):
[E]★ Darts[M]★ Inquisition
10.9 Planar Geometry¶
Subcategory ID: planar_geometry · Topics: 2
10.9.1 Faces in Planar Graph¶
- ID:
planar_graph_faces· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/planar_graph_faces
- Templates (1):
- planar.html
- Resources (1):
- ★ Finding faces of a planar graph and Building planar graph from line segments | CP Algorithms
- Problems (5):
[M]Pipeline Transportation[M]Brother Bear's Garden[M]★ Isolated Island[H]★ Farmers' Tale[H]★ LL’s cake
10.9.2 Point Location¶
- ID:
point_location· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/point_location
- Templates (1):
- Point Location.cpp
- Resources (1):
- Point location | CP Algorithms
- Problems (2):
[E]★ Point Location[M]Football Goal
10.10 Miscellaneous¶
Subcategory ID: miscellaneous · Topics: 6
10.10.1 Hill Climbing and Simulated Annealing¶
- ID:
hill_climbing· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/hill_climbing
- Templates (1):
- Geometry 3D.cpp#L748-L766
- Resources (3):
- Hill climbing | Wiki
- ★ Simple approach of Smallest Circle problem: Hill Climbing Tozan Southerpacks Redcoder
- ★ [Tutorial] Simulated Annealing in Competitive Programming By PurpleCrayon
- Problems (7):
[E]Run Away[E]★ Space Rescuers[M]★ Commentator problem[M]N-Ta-Gon Has a Problem[M]Permutations & Primes[H]Subsequence Reversal[VH]DIY Tree
10.10.2 [Trick] Linear Combination of Vectors¶
- ID:
linear_combination_of_vectors· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/linear_combination_of_vectors
- Resources (1):
- ★ Editorial of 605C - Freelancer's Dreams
- Problems (2):
[M]★ Freelancer's Dreams[M]★ Chemistry Lab
10.10.3 Reflections on a Rectangle¶
- ID:
reflections_on_a_rectangle· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/reflections_on_a_rectangle
- Problems (4):
[E]Ray Tracing[M]★ Energy Production[M]Mirror Box[M]★ Pocket-less Billiards
10.10.4 [Problem] Maximum Area of a Triangle from Given Lengths¶
- ID:
maximum_area_of_a_triangle_from_given_lengths· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/maximum_area_of_a_triangle_from_given_lengths
- Templates (1):
- Maximum Area of Triangle, Given are Lengths.cpp
- Problems (1):
[M]★ Triangle
10.10.5 [Problem] Maximum Area of a Polygon using Given Lengths in CCW Order¶
- ID:
maximum_area_of_a_polygon_using_given_lengths_in_ccw_order· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/maximum_area_of_a_polygon_using_given_lengths_in_ccw_order
- Templates (1):
- Geometry 2D.cpp#L1290-L1384
- Resources (1):
- ★ Maximum area enclosure given side lengths
10.10.6 [Problem] Circle/Polygon Inclusion Tree¶
- ID:
circle_inclusion_hierarchy· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/circle_inclusion_hierarchy
- Templates (1):
- main.cpp
- Resources (1):
- ★ [Tutorial] Finding inclusion hierarchy among circles — An implementation of a sweep-line algorithm By Arpa
- Problems (2):
[M]★ Bomas[H]★ Freedom from Prison
11. Miscellaneous¶
Category ID: miscellaneous · Subcategories: 11 · Topics: 41
11.1 Greedy Algorithms¶
Subcategory ID: greedy_algorithms · Topics: 4
11.1.1 Activity Selection Problem¶
- ID:
activity_selection_problem· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/activity_selection_problem
- Resources (3):
- ★ Activity Selection Problem | Greedy Algo-1 | Geeks for Geeks
- Activity selection problem | Wiki
- ★ Optimal schedule of jobs given their deadlines and durations | CP Algorithms
- Problems (4):
[E]★ Movie Festival II[E]★ Projects[E]★ I AM VERY BUSY[H]★ Swap Space
11.1.2 Fractional Knapsack Problem¶
- ID:
fractional_knapsack_problem· Difficulty: Easy · Importance: ★★☆ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/fractional_knapsack_problem
- Resources (2):
- ★ Fractional Knapsack Problem | Geeks for Geeks
- Fractional Knapsack | avneetsng
- Problems (1):
[E]★ Fractional Knapsack Problem
11.1.3 Huffman Coding¶
- ID:
huffman_coding· Difficulty: Easy · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/huffman_coding
- Templates (1):
- huffman-coding
- Resources (2):
- ★ Huffman Coding | Programiz
- Huffman Coding | Geeks for Geeks
- Problems (4):
[E]★ Hyperhuffman[E]★ Huffman Codes[H]★ Weather Report[H]Huffman Coding on Segment
11.1.4 Exchange Arguments¶
- ID:
exchange_arguments· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/exchange_arguments
- Prerequisites: Basic DP
- Resources (2):
- ★ Lecture #3 — Exchange arguments (sorting with dp) By Errichto
- ★ Episode 14 - Exchange Arguments Algorithms Live!
- Problems (14):
[E]★ No Time for Dragons[E]★ Discounts[M]★ The Smallest String Concatenation[M]★ Pieces of Parentheses[M]★ Maximum Composition[M]★ The Merry Student Life During the Term...[M]★ Annihilate the Beetles[M]Altruistic Amphibians[M]Zabuton[M]Velepin and Marketing[M]Gym Badges[M]Tower[H]Deadline[H]Fuel Finance
11.2 Search Techniques¶
Subcategory ID: search_techniques · Topics: 4
11.2.1 Ternary Search¶
- ID:
ternary_search· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/ternary_search
- Templates (1):
- ternary_search.html#implementation
- Resources (3):
- ★ Ternary Search | CP Algorithms
- ★ Ternary Search on Integers! By Deemo
- Tutorial On Tof (Ternary Search) By Mahdi_Jfri
- Problems (21):
[E]★ Race Time![E]★ Dome of Circus[E]★ Devu and his Brother[E]★ Is This JEE[E]Pyramid[E]Ruler (hard version)[M]★ Weakness and Poorness[M]★ Closest Distance[M]Galactic taxes[M]★ Chasing the Cheetahs[M]★ Vika and Bonuses[M]Trick or Treat[M]Building Construction[M]★ Nature Reserve[M]★ Restorer Distance[M]Kill the Shaitan-Boss[M]★ Simple Skewness[M]Gift Set[M]Lonely Mountain Dungeons[M]Grid Path (Hard)[H]Life Is Dark and Full of Error
11.2.2 Parallel Binary Search¶
- ID:
parallel_binary_search· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/parallel_binary_search
- Templates (1):
- Parallel Binary Search.cpp
- Resources (2):
- ★ Parallel Binary Search [tutorial] By himanshujaju
- Parallel Binary Search Tutorial | Algorithms Conquered
- Problems (12):
[E]★ Meteors[E]★ New Roads Queries[E]Make n00b land great again[M]★ Stamp Rally[M]★ Pictionary[M]Index[M]★ Sign on Fence[H]Travel in HackerLand[H]★ Selective Additions[H]★ Frequency Mismatch (Hard Version)[H]Manhattan Christmas Tree[H]AQT's Tree Game
11.2.3 Fraction Binary Search¶
- ID:
fraction_binary_search· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/fraction_binary_search
- Templates (1):
- Fraction Binary Search.cpp
- Resources (4):
- Fraction Search Algorithm | CP Algorithm
- Solution by Xylofo
- The "guess the number" game for arbitrary rational numbers?
- Integer binary search and Farey series By ifsmirnov
- Problems (2):
[M]From Modular to Rational[H]Infinite Fraction Sequence
11.2.4 Fracturing Search¶
- ID:
fracturing_search· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/fracturing_search
- Resources (2):
- ★ Fracturing Search | USACO Guide
- ★ Episode 32 - Fracturing Search Algorithms Live!
- Problems (4):
[E]★ Find K Pairs with Smallest Sums[M]Robotic Cow Herd[M]★ Olympiads[VH]Shopping Plans
11.3 Interactive Problems¶
Subcategory ID: interactive_problems · Topics: 2
11.3.1 Interactive Problems¶
- ID:
interactive_problems· Difficulty: Easy · Importance: ★★★ · Phase: 1 - Topic page: https://youkn0wwho.academy/topic-list/interactive_problems
- Resources (1):
- ★ Interactive Problems: Guide for Participants By MikeMirzayanov
- Problems (30):
[E]★ Guess the Number[E]★ Interview[E]★ Prime Factors[E]★ Guessing the Greatest (easy version)[E]★ Bear and Prime 100[E]Hidden Permutations[E]XOR Guessing[E]Omkar and the Meaning of Life[E]★ Bit Guessing Game[E]★ Anya's Simultaneous Exhibition[E]★ Decreasing Game[E]Trailing Zeros[E]Create Tree[E]★ Jump[M]★ Lost Tree[M]Enchanted Artifact[M]★ Missing String[M]★ Chocolate Bunny[M]★ Bitwise Queries (Easy Version)[M]★ X-OR[M]Limited Moves[M]Take a Guess[M]Ruler (easy version)[H]★ Guess Divisors Count[H]★ Lost Root[H]★ Election Spies[H]Interactive Bulls and Cows (Hard)[H]Basin City Surveillance[VH]★ Eliminate Edges[VH]★ Find the Tree
11.3.2 Interactive Problems on Centroids¶
- ID:
interactive_problems_on_centroids· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/interactive_problems_on_centroids
- Resources (1):
- ★ Editorial of 1174F - Ehab and the Big Finale
- Problems (3):
[E]★ Ehab and the Big Finale[E]★ Find the Special Node[VH]Centroid Guess
11.4 Permutations¶
Subcategory ID: permutations · Topics: 3
11.4.1 Permutations and Permutation Cycles¶
- ID:
permutation_cycles· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/permutation_cycles
- Templates (1):
- Permutation Cycles.cpp
- Resources (7):
- ★ [Tutorial] A comprehensive guide to permutations for beginners By nor
- Permutation | Wiki
- ★ Linear time algorithm for parity of permutation, around 1591D By thematdev
- ★ Minimum swaps to sort an array | Geeks for Geeks
- ★ The Riddle That Seems Impossible Even If You Know The Answer Veritasium
- Problem Solving Session on Cycles in Permutations by Archit Manas
- Cycles in Permutations by Archit Manas
- Problems (14):
[E]★ Permutation Cycles[E]★ Sorting by Swapping[E]Permutations[E]★ Sakurako, Kosuke, and the Permutation[M]★ Permutations[M]★ Lucky Permutation[M]★ Infinite Path[M]★ Square Root of Permutation[M]★ Yet Another Sorting Problem[M]★ Inversion Counting[M]★ Petr and Permutations[M]★ The Cabins in the Woods[M]Permutation Cost Sum[H]★ D-Power Permutations
11.4.2 [Problem] K-th Root of a Permutation¶
- ID:
kth_root_of_a_permutation· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/kth_root_of_a_permutation
- Templates (1):
- K-th Root of a Permutation.cpp
- Resources (1):
- ★ Editorial of Sasha and Swaps by adamant
- Problems (2):
[M]★ Square Root of Permutation[M]★ Sasha and Swaps
11.4.3 Schreier–Sims Algorithm¶
- ID:
schreier_sims_algorithm· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/schreier_sims_algorithm
- Templates (1):
- Schreier–Sims algorithm.cpp
- Resources (3):
- ★ Permutation group basis construction (Schreier–Sims algorithm) By adamant
- ★ Schraer-Sims algorithm for dummies | Zlobober
- Another Problem using this Algorithm, but not sure if you can access it
- Problems (1):
[E]★ Permutations
11.5 Matroids¶
Subcategory ID: matroids · Topics: 1
11.5.1 Matroid Intersection¶
- ID:
matroid_intersection· Difficulty: Very Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/matroid_intersection
- Templates (3):
- Matroid Intersection Color Linear Matroid.cpp
- Matroid Intersection Color Graphic Matroid.cpp
- graphicGraphicMatroid.cpp
- Resources (2):
- ★ [Tutorial] Matroid intersection in simple words By ATSTNG
- Matroid | Wiki
- Problems (14):
[E]★ Pick Your Own Nim[E]★ Coin Collecting[E]Demonstration of Honesty![E]Communicating Servers[M]★ Faulty System[M]★ MEXimum Spanning Tree[M]ICPC Kingdom[M]★ Rainbow Graph[M]Ambiguous Forests[M]★ Colorful Spanning Tree[H]Seollal[H]★ Hamel Paths[VH]DIY Tree[VH]TST
11.6 Chess¶
Subcategory ID: chess · Topics: 3
11.6.1 [Problem] Knight Moves in Infinity Grid¶
- ID:
knight_moves_in_infinity_grid· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/knight_moves_in_infinity_grid
- Templates (1):
- Knight Moves in Infinity Grid.cpp
- Resources (1):
- ★ Knight’s move on infinite chess board with constant time and space | Adem Atalay
11.6.2 [Problem] Knight's Tour Problem¶
- ID:
knights_tour_problem· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/knights_tour_problem
- Resources (3):
- ★ 19.4 Knight’s tours | CPH
- ★ Warnsdorff’s algorithm for Knight’s tour problem | Geeks for Geeks
- Knight's Tour Problem | Backtracking | Code Dope
- Problems (1):
[E]Knight's Tour
11.6.3 [Problem] Bishop Placement¶
- ID:
bishop_placement· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/bishop_placement
- Templates (1):
- bishops-on-chessboard.html#implementation
- Resources (1):
- Placing Bishops on a Chessboard | CP Algorithms
- Problems (1):
[E]★ Counting Bishops
11.7 Techniques¶
Subcategory ID: techniques · Topics: 9
11.7.1 Coordinate Compression¶
- ID:
coordinate_compression· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/coordinate_compression
- Resources (5):
- ★ Coordinate Compression | A small but an useful trick to have in the armoury | take U forward
- What is coordinate compression?
- Coordinate Compression | Geeks for Geeks
- ★ Coordinate Compression | Algorithms Digest
- ★ My code for coordinate compression By rembocoder
- Problems (11):
[E]★ Covered Points Count[E]★ Restaurant Customers[E]★ Salary Queries[E]Shuffling Songs[E]★ K-query[M]★ Increasing subsequence II[M]★ Distinct Values Queries[M]Infinite Inversions[M]Turn Off The TV[M]Crazy Fences[M]★ Rectangular Pasture
11.7.2 Direction Array¶
- ID:
direction_array· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/direction_array
- Prerequisites: DFS/BFS
- Resources (2):
- ★ An Efficient (and quite common) Way to Navigate Grid Problems [C++] By Jellyman102
- ডিরেকশন অ্যারে | শাফায়েতের ব্লগ
- Problems (9):
[E]★ Counting Rooms[E]★ King's Path[E]★ Maze[E]Ice Cave[E]Igor In the Museum[E]Solve The Maze[E]Fox And Two Dots[E]Statues[E]Set of Strangers
11.7.3 Meet in the Middle¶
- ID:
meet_in_the_middle· Difficulty: Easy · Importance: ★★★ · Phase: 4 - Topic page: https://youkn0wwho.academy/topic-list/meet_in_the_middle
- Templates (1):
- meet-in-the-middle?lang=cpp#meet-in-the-middle-solution
- Resources (3):
- ★ Meet in the Middle | Tutorial & Problems | Errichto Hard Algorithms
- ★ 5.5 Meet in the middle | CPH
- Meet In The Middle | USACO Guide
- Problems (17):
[E]★ Meet in the Middle[E]★ Subset Sums[E]★ Maximum Subsequence[E]Robot Instructions[E]★ Sum of Four Values[E]★ Подарок[E]★ Maximum Independent Set[M]★ Xor-Paths[M]★ Prime Gift[M]★ Algebra Flash[M]★ Make Them Similar[M]★ Path to Integer[H]Lizard Era: Beginning[H]Knapsack Queries on a tree[H]Playlist[H]★ Number Clicker[H]actGenshinImp
11.7.4 Invariants and Monovariants¶
- ID:
invariants_and_monovariants· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/invariants_and_monovariants
- Resources (2):
- ★ [Tutorial] Invariants and Monovariants By TooNewbie
- ★ Invariant List | Share Your Invariant Here! By muhammadhasan01
- Problems (14):
[E]★ Coin Piles[E]★ Chess For Three[M]★ Yet Another Sorting Problem[M]★ Contrast[M]The Human Equation[M]Corner Twist[M]★ Find the Maximum Sum of Node Values[M]★ Swap Dilemma[M]Simultaneous Swap[M]★ Magic Stones[M]Button Pressing[M]Operating on A[H]Flipping Range[H]Swaps Again
11.7.5 Manhattan <> Chebyshev¶
- ID:
manhattan_chebyshev· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/manhattan_chebyshev
-
Author's blog:
For two points (x1, y1) and (x2, y2), we have the following relations between Manhattan and Chebyshev distance:
- Manhattan -> Chebyshev:
Manhattan Distance = |x1 - x2| + |y1 - y2|
Trick: Rotate 45 degrees. Let p1 = x1 + y1, p2 = x2 + y2, q1 = x1 - y1, q2 = x2 - y2, then Chebyshev Distance = max(|p1 - p2|, |q1 - q2|)
- Chebyshev -> Manhattan:
Chebyshev Distance =max(|x1 - x2|, |y1 - y2|)
Trick: Rotate 45 degrees. Then Manhattan Distance = 1⁄2 * (|p1 - p2| + |q1 - q2|) -
Resources (4):
- Manhattan distance | Wiki
- Chebyshev distance | Wiki
- ★ Manhattan trick [Tutorial] (also I have never traveled to Manhattan) By Wandoka
- ★ Manhattan distance trick in higher dimensions By kaldiuo
- Problems (8):
[E]★ Dist Max[E]★ Manhattan[M]Four Coloring[M]Teleports[M]Game with Tokens[H]★ The Ultimate Bamboo Eater[H]Manhattan Christmas Tree[VH]★ Pairs
11.7.6 LCM OR Technique¶
- ID:
lcm_or_technique· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/lcm_or_technique
- Resources (1):
- ★ F - Subsequence LCM Editorial
- Problems (3):
[M]★ Subsequence LCM[M]★ LCM Divisible Subsequence[H]★ Mysterious LCM
11.7.7 [Trick] Logarithmic Subarray Aggregator (LSA Trick)¶
- ID:
logarithmic_bruteforce· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/logarithmic_bruteforce
-
Author's blog:
Imagine a problem where you have to find sum of all subarray GCDs.
Normally you will have to use sparse table and binary search to solve this by leveraging the fact that there will be O(log(MAX)) different GCDs ending at each index.
But you can do this in a better way with minimal code! You can store a vector or map v[r] which stores all GCDs of subarrays ending at r.
Note that there will be O(log(MAX)) different GCDs ending at r. So, you can store their info directly in the vector.
Then, you can iterate over all elements in v[r] to get the vector v[r+1].
So, you are basically doing a bruteforce in log(N) time. Pretty simple and elegant!
You can do the same for subarray AND, OR etc.
Check the template code below for a better understanding. -
Templates (1):
- Logarithmic Subarray Aggregator.cpp
- Problems (10):
[E]★ Bitwise ORs of Subarrays[E]★ The Brand New Function[M]★ CGCDSSQ[M]★ Maximum of GCDs[M]★ Have Some Water[M]Eri and Expanded Sets[M]★ Alter the GCD[M]★ GCD Counting[H]★ GCD cost on the tree[H]★ Different GCD Subarray Query
11.7.8 Bitwise Disjoint Partitioning¶
- ID:
bitwise_disjoint_partitioning· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/bitwise_disjoint_partitioning
- Resources (1):
- ★ Disjoint partitioning with binary representation | Nafis
- Problems (3):
[M]★ ICC[M]★ The penguin's game[M]Remont
11.7.9 [Trick] Efficient Non-Increasing Sequence Recovery of Length n with a[i] <= n/i¶
- ID:
sqrt_n_sequence_recovery· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/sqrt_n_sequence_recovery
- Templates (1):
- 134445
- Resources (1):
- ★ Determine A Non-Increasing Integer Sequence of Length n with a[k]<=n/k in O(sqrt(n)) Steps By Nachia
- Problems (4):
[E]★ You Are Given a Tree[M]★ Division + LCP (hard version)[M]★ Till I Collapse[H]Complex Segments (Hard Version)
11.8 Min Plus Convolution¶
Subcategory ID: min_plus_convolution · Topics: 2
11.8.1 Min Plus Convolution (Convex and Convex)¶
- ID:
min_plus_convolution_convex_and_convex· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/min_plus_convolution_convex_and_convex
- Templates (1):
- Min Plus Convolution (Convex and Convex).cpp
- Resources (2):
- ★ [Tutorial] Knapsack, Subset Sum and the (max,+) Convolution By errorgorn
- ★ A comment by square1001
- Problems (3):
[E]★ Min Plus Convolution (Convex and Convex)[M]Candies[H]Red and Blue Lamps
11.8.2 SMAWK Algorithm and Min Plus Convolution (Convex and Arbitrary)¶
- ID:
min_plus_convolution_convex_and_arbitrary· Difficulty: Very Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/min_plus_convolution_convex_and_arbitrary
- Templates (1):
- 185910
- Resources (3):
- ★ The SMAWK Algorithm
- ★ SMAWK algorithm as an alternative for D&C optimization By ko_osaga,
- ★ [Tutorial] Knapsack, Subset Sum and the (max,+) Convolution By errorgorn
- Problems (4):
[E]★ Min Plus Convolution (Convex and Arbitrary)[M]Sum[H]Holiday[H]Milutin's Plums
11.9 Randomized¶
Subcategory ID: randomized · Topics: 2
11.9.1 Randomized Algorithms¶
- ID:
randomized_algorithms· Difficulty: Medium · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/randomized_algorithms
- Resources (2):
- ★ Randomized algorithms lecture, part 1 & 2 By Errichto
- Randomization tasks By Radewoosh
- Problems (14):
[E]★ Johnny English Strikes Again[E]★ Kuroni and the Punishment[E]★ Jump[E]★ Matrix God[E]★ Buratsuta 3[M]★ Destiny[M]Node Picking[M]★ Finding Lines[M]★ Turtle and Three Sequences[M]★ Ghd[M]★ GCD[H]★ Lost Root[H]Interactive Bulls and Cows (Hard)[H]Basin City Surveillance
11.9.2 Birthday Paradox¶
- ID:
birthday_paradox· Difficulty: Medium · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/birthday_paradox
- Resources (3):
- ★ Randomized algorithms lecture #2 - birthday paradox, random shuffle, hashing Errichto Algorithms
- ★ How to blow up too weak hashing without thinking By physics0523
- ★ Birthday problem | Wiki
- Problems (2):
[M]★ Birthday Paradox[H]★ Number Clicker
11.10 Bigint¶
Subcategory ID: bigint · Topics: 2
11.10.1 Big Integers¶
- ID:
bigint· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/bigint
- Templates (1):
- BigInt.cpp
- Resources (2):
- ★ BigInt (BIG INTEGERS) in C++ with Example (GFG)
- How to use BigInt?
- Problems (8):
[E]★ Addition of Big Integers[E]Simple Multiplication[E]★ Fast Multiplication[E]★ Very Fast Multiplication[E]★ Multiplication of Big Integers[M]★ Division of Big Integers[M]★ Perfect Encoding[M]Help King
11.10.2 Trygub Numbers¶
- ID:
trygub_numbers· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/trygub_numbers
- Templates (1):
- Trygub Num.cpp
- Resources (1):
- ★ Big integers with negative digits: The Trygub numbers By adamant
- Problems (4):
[E]Powers of Two[M]整数[VH]Half-sum[VH]M-tree
11.11 Miscellaneous¶
Subcategory ID: miscellaneous · Topics: 9
11.11.1 Inversions¶
- ID:
inversions· Difficulty: Easy · Importance: ★★★ · Phase: 2 - Topic page: https://youkn0wwho.academy/topic-list/inversions
- Prerequisites: Segment Tree or Fenwick Tree
- Templates (1):
- Inversions.cpp
- Resources (1):
- ★ [Tutorial] Problems about swapping adjacent elements By TheScrasse
- Problems (20):
[E]★ Inversion Count[E]★ Swapping numbers[E]★ Minimize Inversions[E]★ Make the strings equal[E]Mega Inversions[E]Greetings[M]★ String Reversal[M]★ Swaps 2[M]Luna Likes Love[M]★ Papple Sort[M]Sorted and Sorted[M]Arranging Shoes[M]★ Inversion Counting[M]Kill Anton[M]Inversions problem[M]★ K-inversions[M]★ Sherlock and Inversions[M]★ Static Range Inversions Query[H]Group Photo[H]★ Counting inversions
11.11.2 Josephus Problem¶
- ID:
josephus_problem· Difficulty: Easy · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/josephus_problem
- Templates (1):
- Josephus Problem.cpp
- Resources (3):
- ★ Josephus Problem | CP Algorithms
- Multiple people Josephus problem By ad_red
- ★ The Josephus Problem - Numberphile
- Problems (5):
[E]★ Josephus Problem I[E]★ Josephus Problem II[E]Lucky Number[E]★ Josephus Queries[E]★ Josephus Again
11.11.3 Gray Code¶
- ID:
gray_code· Difficulty: Easy · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/gray_code
- Templates (1):
- Gray Code.cpp
- Resources (1):
- ★ Gray code | CP Algorithms
- Problems (4):
[E]★ Gray Code[E]★ Grey Codes[E]★ Тест[M]Matrix
11.11.4 Backtracking¶
- ID:
backtracking· Difficulty: Easy · Importance: ★★★ - Topic page: https://youkn0wwho.academy/topic-list/backtracking
- Resources (12):
- ★ What is Backtracking Algorithm? Types, Examples & its Application By Soni Upadhyay
- ★ Backtracking tutorial: power set WilliamFiset
- ★ Recursion and Backtracking | HackerEarth
- ★ Introduction to Backtracking – Data Structure and Algorithm Tutorials | Geeks for Geeks
- Backtracking Algorithm | Programiz
- N Queens Problem | Geeks for Geeks
- Sudoku | Geeks for Geeks
- M coloring problem | Geeks for Geeks
- Hamiltonian path problem | Wiki
- Eight queens puzzle | Wiki
- Knight's tour | Wiki
- 15 Puzzle Game: Existence Of The Solution | CP Algorithms
- Problems (25):
[E]★ Dreamoon and WiFi[E]★ Tower of Hanoi[E]★ Passwords[E]★ Red and Black[E]★ 8 Queens Chess Problem[E]The Sultan's Successors[E]Don't Get Rooked[E]★ Map Colouring[E]Prime Ring Problem[E]★ Hamiltonian Cycle[E]Jugs[E]Back to the 8-Queens[E]★ 23 out of 5[E]★ All Walks of length "n" from the first node[E]Knight's Tour[E]★ Creating Strings[E]★ Chessboard and Queens[M]★ Random Digital Exponentiation[M]Codovid Virus[M]★ A problem of Backtracking[M]Sum It Up[H]Smallest Inverse Euler Totient Function[H]★ N Queen Again[VH]★ Faketorial Hashing[VH]★ Enumerate Cliques
11.11.5 [Problem] MEX of all Subarrays¶
- ID:
mex_of_all_subarrays· Difficulty: Hard · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/mex_of_all_subarrays
- Templates (1):
- MEX of all Subarrays.cpp
- Resources (3):
- ★ Editorial of 1148H - Holy Diver
- ★ Editorial of F | YouKn0wWho
- Offline Range MEX queries in O(log n) By one_autum_leaf
- Problems (3):
[E]★ Complicated Computations[H]★ F[H]★ Holy Diver
11.11.6 Lindstrom Gessel Viennot(LGV) Lemma¶
- ID:
lindstrom_gessel_viennot_lemma· Difficulty: Hard · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/lindstrom_gessel_viennot_lemma
- Resources (2):
- ★ Lattice paths and Lindström–Gessel–Viennot lemma By miaowtin
- ★ Lindström–Gessel–Viennot lemma | Wiki
- Problems (1):
[E]★ Turtles
11.11.7 Dynamic Bitsets¶
- ID:
dynamic_bitsets· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/dynamic_bitsets
- Resources (1):
- ★ Dynamic Bitsets in GCC By bitset
- Problems (2):
[E]Triangle[M]★ PermuTree (hard version)
11.11.8 Pragmas¶
- ID:
pragmas· Difficulty: Medium · Importance: ★★☆ - Topic page: https://youkn0wwho.academy/topic-list/pragmas
- Resources (6):
- ★ #pragma Directive in C | Geeks for Geeks
- ★ Speeding Up for Naive Algorithm By E869120
- ★ Speed up Code executions with help of Pragma in C/C++ | Geeks for Geeks
- ★ Tree queries for O(nq) By Golovanov399
- Using pragmas efficiently in C++
- ★ Vectorization in C++ | USACO Guide
- Problems (6):
[E]★ Mass Change Queries[E]★ Awesome Substrings[M]Nagini[M]★ Sonya and Gifts[M]May Holidays[H]★ Welcome home, Chtholly
11.11.9 Boyer–Moore Voting Algorithm and Misra–Gries Algorithm¶
- ID:
boyer_moore_voting_algorithm_and_misra_gries_algorithm· Difficulty: Easy · Importance: ★☆☆ - Topic page: https://youkn0wwho.academy/topic-list/boyer_moore_voting_algorithm_and_misra_gries_algorithm
- Resources (7):
- ★ Boyer–Moore majority vote algorithm | Wikipedia
- Boyer-Moore Majority Voting Algorithm | GeeksForFeeks
- Boyer-Moore Majority Voting Algorithm by Anil Goyal
- ★ Boyer Moore majority vote algorithm | TopCoder
- ★ Misra–Gries heavy hitters algorithm | Wikipedia
- ★ The streaming model, and how to estimate the most frequent elements with the Misra-Gries algorithm by Stéphane Guichard
- Dominant Path Queries discussion By ExtraStageLover
- Problems (4):
[E]★ Buratsuta 3[E]★ Majority Element[E]★ Majority Element II[M]★ Destiny
Useful Links (from the topic-list page)¶
- Codeforces
- AtCoder
- CodeChef
- Codeforces Catalog
- A list of almost all useful blogs ever published on Codeforces (parveen1981)
- (Plenty of) useful blogs in Codeforces (tallnut_liu)
- Helpful Codeforces Extensions (MohamedAboOkail)
- Stress Testing (C137)
- AtCoder Problems
- CSES Problem Set
- Library Checker
- VJudge
- StopStalk
- CP Algorithms
- USACO Guide
- VisuAlgo
- Graph Editor (CSAcademy)
- A List of Useful Equations in Competitive Programming (YouKn0wWho)
- Common Mistakes in Competitive Programming and How to Avoid Them (YouKn0wWho)
- CP Trainer (Michal Opala)
Totals: 11 categories · 126 subcategories · 570 topics · 1542 resource links · 451 template links · 4437 topic→problem links (3888 unique problems).