On the Fundamental Limits of Exact Inference in Structured Prediction