A number of runners competed in a race. When Ammar finished, there were half as many runners who had finished before him compared to the number who finished behind him. Julia was the 10th runner to finish behind Ammar. There were twice as many runners who had finished before Julia compared to the number who finished behind her. How many runners were there in the race?
1. Let \( k \) be the position at which Ammar finished. Therefore, there are \( k-1 \) runners who finished before him and \( 2(k-1) \) runners who finished after him. This gives us the total number of runners as:
   \[
   k - 1 + 2(k - 1) + 1 = 3k - 2
   \]
   Here, we add 1 to account for Ammar himself.

2. Julia finished 10 positions behind Ammar, so her position is \( k + 10 \). Therefore, there are \( k + 9 \) runners who finished before her and \( 3k - 2 - (k + 10) = 2k - 12 \) runners who finished after her.

3. According to the problem, the number of runners who finished before Julia is twice the number of runners who finished after her. Therefore, we set up the equation:
   \[
   k + 9 = 2(2k - 12)
   \]

4. Solving the equation:
   \[
   k + 9 = 4k - 24
   \]
   \[
   9 + 24 = 4k - k
   \]
   \[
   33 = 3k
   \]
   \[
   k = 11
   \]

5. Substituting \( k = 11 \) back into the total number of runners formula:
   \[
   3k - 2 = 3(11) - 2 = 33 - 2 = 31
   \]

The final answer is \(\boxed{31}\).