Let $r_1,r_2,\ldots,r_m$ be positive rational numbers with a sum of $1$. Find the maximum values of the function $f:\mathbb N\to\mathbb Z$ defined by
$$f(n)=n-\lfloor r_1n\rfloor-\lfloor r_2n\rfloor-\ldots-\lfloor r_mn\rfloor$$
1. **Understanding the function and the problem:**
   We are given a function \( f(n) = n - \lfloor r_1 n \rfloor - \lfloor r_2 n \rfloor - \ldots - \lfloor r_m n \rfloor \), where \( r_1, r_2, \ldots, r_m \) are positive rational numbers that sum to 1. We need to find the maximum value of this function.

2. **Initial bounds and properties:**
   Since \( r_1 + r_2 + \ldots + r_m = 1 \), we can write:
   \[
   \sum_{i=1}^m r_i = 1
   \]
   For any integer \( n \), the floor function \( \lfloor r_i n \rfloor \) satisfies:
   \[
   \lfloor r_i n \rfloor \leq r_i n < \lfloor r_i n \rfloor + 1
   \]
   Therefore:
   \[
   \sum_{i=1}^m \lfloor r_i n \rfloor \leq \sum_{i=1}^m r_i n = n
   \]
   This implies:
   \[
   n - \sum_{i=1}^m \lfloor r_i n \rfloor \geq 0
   \]
   Hence, \( f(n) \geq 0 \).

3. **Maximum value analysis:**
   To find the maximum value of \( f(n) \), we need to consider the difference between \( r_i n \) and \( \lfloor r_i n \rfloor \). Specifically:
   \[
   r_i n - \lfloor r_i n \rfloor < 1
   \]
   Summing these differences for all \( i \):
   \[
   \sum_{i=1}^m (r_i n - \lfloor r_i n \rfloor) = \sum_{i=1}^m r_i n - \sum_{i=1}^m \lfloor r_i n \rfloor = n - \sum_{i=1}^m \lfloor r_i n \rfloor
   \]
   Therefore:
   \[
   f(n) = n - \sum_{i=1}^m \lfloor r_i n \rfloor = \sum_{i=1}^m (r_i n - \lfloor r_i n \rfloor)
   \]
   Each term \( r_i n - \lfloor r_i n \rfloor \) is less than 1, so the sum of these terms is less than \( m \):
   \[
   f(n) < m
   \]

4. **Achieving the maximum value:**
   The maximum value of \( f(n) \) is achieved when each \( r_i n - \lfloor r_i n \rfloor \) is as close to 1 as possible. This happens when \( n \) is just before a multiple of the least common multiple (LCM) of the denominators of \( r_1, r_2, \ldots, r_m \). At this point, each \( r_i n \) is just less than an integer, making \( r_i n - \lfloor r_i n \rfloor \) close to 1.

5. **Conclusion:**
   The maximum value of \( f(n) \) is \( m - \epsilon \), where \( \epsilon \) is a small positive number approaching 0 as \( n \) approaches a multiple of the LCM of the denominators of \( r_1, r_2, \ldots, r_m \).

The final answer is \( \boxed{ m - \epsilon } \) where \( \epsilon \) is a small positive number approaching 0.