The Riemann-Roch theorem for elliptic operators and solvability of elliptic equations with additional conditions on compact subsets