input: Write a Python function named `count_distinct_colors` that accepts an integer `limit` and a 2D list `queries`. The function should manage `limit + 1` balls labeled from `0` to `limit`, which are initially all uncolored. For each pair `[x, y]` in `queries`, assign color `y` to ball `x`. After each assignment, determine the number of unique colors on the balls. Return a list where each element specifies the number of distinct colors after each query.
  
  
  from typing import List
  
  def count_distinct_colors(limit: int, queries: List[List[int]]) -> List[int]:
      """
      Given a total of 'limit' balls and a list of queries, assign colors to the balls as specified by each query.
      Ball labels range from 0 to 'limit' and each ball can have only one color. After processing each query, return the count of unique colors applied to the balls so far.
  
      Example:
      >>> limit = 4, queries = [[1, 4], [2, 5], [1, 3], [3, 4]]
      [1, 2, 2, 3]
      >>> limit = 4, queries = [[0, 1], [1, 2], [2, 2], [3, 4], [4, 5]]
      [1, 2, 2, 3, 4]
  
      Constraints:
      1 <= limit <= 10^9
      1 <= n == len(queries) <= 10^5
      len(queries[i]) == 2
      0 <= queries[i][0] <= limit
      1 <= queries[i][1] <= 10^9
      """
  
output: def count_distinct_colors(limit: int, queries: List[List[int]]) -> List[int]:
      color_map = {}
      result = []
      for x, y in queries:
          color_map[x] = y
          result.append(len(set(color_map.values())))
      return result