A computer generates all pairs of real numbers $x, y \in (0, 1)$ for which the numbers $a = x+my$ and $b = y+mx$ are both integers, where $m$ is a given positive integer. Finding one such pair $(x, y)$ takes $5$ seconds. Find $m$ if  the computer needs $595$ seconds to find all possible ordered pairs $(x, y)$.
1. **Understanding the problem:**
   We need to find pairs \((x, y) \in (0, 1)\) such that \(a = x + my\) and \(b = y + mx\) are both integers, where \(m\) is a given positive integer. Each pair takes 5 seconds to find, and the computer needs 595 seconds to find all possible pairs. We need to determine \(m\).

2. **Initial analysis:**
   For \(m = 1\), we have \(a = x + y\) and \(b = y + x\), which implies \(x + y\) must be an integer. Since \(x, y \in (0, 1)\), the only possible integer value for \(x + y\) is 1. This gives infinitely many solutions, so \(m\) cannot be 1.

3. **Considering \(m > 1\):**
   Let \(a + b = u\) and \(a - b = v\). Then:
   \[
   a = \frac{u + v}{2}, \quad b = \frac{u - v}{2}
   \]
   Substituting \(a = x + my\) and \(b = y + mx\), we get:
   \[
   x + my = \frac{u + v}{2}, \quad y + mx = \frac{u - v}{2}
   \]
   Solving for \(x\) and \(y\):
   \[
   x = \frac{u}{2(m+1)} - \frac{v}{2(m-1)}, \quad y = \frac{u}{2(m+1)} + \frac{v}{2(m-1)}
   \]

4. **Constraints on \(x\) and \(y\):**
   Since \(x, y \in (0, 1)\), we have:
   \[
   0 < \frac{u}{2(m+1)} - \frac{v}{2(m-1)} < 1, \quad 0 < \frac{u}{2(m+1)} + \frac{v}{2(m-1)} < 1
   \]
   This implies:
   \[
   0 < \frac{u}{2(m+1)} < 1 + \frac{v}{2(m-1)}, \quad 0 < \frac{u}{2(m+1)} < 1 - \frac{v}{2(m-1)}
   \]

5. **Simplifying the constraints:**
   For \(v = 0\):
   \[
   x = y = \frac{u}{2(m+1)}
   \]
   \(u\) must be even, and \(u \in \{2, 4, 6, \ldots, 2m\}\), giving \(m\) solutions.

6. **Considering \(v > 0\):**
   For \(v > 0\), we have:
   \[
   1 - \frac{v}{2(m-1)} > \frac{u}{2(m+1)} > \frac{v}{2(m-1)}
   \]
   This implies:
   \[
   1 \le v \le m - 2
   \]
   and:
   \[
   2m + 2 - v - \frac{2v}{m-1} > u > v + \frac{2v}{m-1}
   \]
   Since \(u\) and \(v\) must be both even or both odd, we get:
   \[
   2m - v \ge u \ge v + 2
   \]
   giving \(m - v\) possibilities for each \(v\).

7. **Counting the total number of solutions:**
   Summing up the possibilities:
   \[
   \sum_{v=1}^{m-2} (m - v) = \frac{(m-1)(m-2)}{2}
   \]
   Including the \(m\) solutions for \(v = 0\), the total number of solutions is:
   \[
   m + 2 \sum_{v=1}^{m-2} (m - v) = m + 2 \cdot \frac{(m-1)(m-2)}{2} = m + (m-1)(m-2) = m^2 - 2
   \]

8. **Solving for \(m\):**
   Given that the computer takes 595 seconds to find all pairs, and each pair takes 5 seconds:
   \[
   m^2 - 2 = \frac{595}{5} = 119
   \]
   Solving for \(m\):
   \[
   m^2 = 121 \implies m = 11
   \]

The final answer is \(\boxed{m = 11}\)