Introductory Number Theory
DivisibilityModular Arithmetic
Dynamic Programming
Introduction to DPKnapsack DPPaths on Grids(Optional) Longest Increasing Subsequence
Graphs
Breadth First Search (BFS)Disjoint Set UnionTopological SortShortest Paths with Non-Negative Edge WeightsMinimum Spanning Trees
Data Structures
StacksSliding WindowPoint Update Range Sum
Trees
Euler Tour TechniqueDP on Trees - Introduction(Optional) DP on Trees - Solving For All Roots
Hashing
String Hashing(Optional) Unordered Sets & Maps(Optional) A Faster Hash Table in C++

CSES - Distinct Values Queries

Authors: Benjamin Qi, Andrew Wang, Óscar Garries

Appears In

  • Gold - Point Update Range Sum

Edit with LiveUpdate

Hint

Solution

Join the USACO Forum!

Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!

Join Forum