Locally minimax optimal and dimension-agnostic discrete argmin inference