    #include <iostream>
    #include <vector>
    #include <algorithm>
    
    struct results {
      unsigned int id; //id of the team
      unsigned int m; //number of solved problems
    };
    
    // I guess you're trying to sort on number of solved problems. If not, change `.m` to `.id`
    bool comparare(const results lhs, const results rhs) {
      return lhs.m > rhs.m;
    }
    
    int main() {
    
      size_t n;
      
      std::cout << "Enter number of results: " << std::endl;
      std::cin >> n;

     std::vector<results> standings(n); // Creates std::vector of results with n elements

      // read in id and number of problems solved
      for(size_t i=0; i < n; ++i) {
        std::cin >> standings[i].id >> standings[i].m;
      }
    
      // sort the array
      std::sort(standings.begin(), standings.end(), comparare);
    
      // output the sorted array's id
      for(size_t i = 0; i < standings.size(); ++i) {
        std::cout << "In " << i+1 << " place: " << standings[i].id << " with " << standings[i].m << " problems solved." << std::endl;
      }
    
      return 0;
    }