Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <string>
#include <algorithm>
#include <string>
#include <climits>
#include <utility>

#define REP(i, n) for (int (i) = 0; (i) < (int)(n); (i)++)
#define REG(i, a, b) for (int (i) = ((int)(a)); (i) < ((int)(b)); i++)
#define ALL(V) (V).begin(), (V).end()
#define PRINT(STR) cout << (STR) << endl
#define ROUNDED(N) fixed << setprecision(N)
#define SPACE " "

typedef long long ll;
using namespace std;

int nextInt() { int n; cin >> n; return n; }
double nextDouble() { double d; cin >> d; return d; }
string nextString() { string str; cin >> str; return str; }

int main() {
	cin.tie(0); //?????±?????????????????????
	ios::sync_with_stdio(false); //printf??¨??±??????????????????
	int M,T,P,R;
	while(cin>>M>>T>>P>>R,M){
		vector<vector<pair<int,int>>> team(T,vector<pair<bool,int>>(P,make_pair(false,0)));//first is the number of problem
		REP(i,R){
			int m,t,p,j;
			cin >> m>>t>>p>>j;
			if(!j){
				team[t][p].first = true;
				team[t][p].second += t;
			}else{
				team[t][p].second += 20;
			}
		}
		vector<pair<int,pair<int,int>>> teamres(T,make_pair(0,make_pair(15000,0)));
		REP(i,T){
			teamres[i].second.second = i;
			REP(j,P){
				if(team[i][j].first){
					teamres[i].first++;
					teamres[i].second.first -= team[i][j].second;
				}
			}
		}
		sort(ALL(teamres));
		reverse(ALL(teamres));
			REP(i,T-1){
				if(teamres[i].first == teamres[i+1].first && teamres[i].second.first == teamres[i+1].second.first){
					cout << teamres[i].second.second << "=";
				}else{
					cout << teamres[i].second.second << ",";
				}
			}
			cout << teamres[T-1].second.second << endl;

}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:98: error: no matching function for call to 'std::vector<std::vector<std::pair<int, int> > >::vector(int&, std::vector<std::pair<bool, int> >)'
   37 |                 vector<vector<pair<int,int>>> team(T,vector<pair<bool,int>>(P,make_pair(false,0)));//first is the number of problem
      |                                                                                                  ^
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >]'
  707 |         vector(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:707:9: note:   template argument deduction/substitution failed:
a.cc:37:98: note:   deduced conflicting types for parameter '_InputIterator' ('int' and 'std::vector<std::pair<bool, int> >')
   37 |                 vector<vector<pair<int,int>>> team(T,vector<pair<bool,int>>(P,make_pair(false,0)));//first is the number of problem
      |                                                                                                  ^
/usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >; allocator_type = std::allocator<std::vector<std::pair<int, int> > >]'
  678 |       vector(initializer_list<value_type> __l,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:678:43: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<std::vector<std::pair<int, int> > >'
  678 |       vector(initializer_list<value_type> __l,
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >; std::__type_identity_t<_Alloc> = std::allocator<std::vector<std::pair<int, int> > >]'
  659 |       vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:659:23: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::vector<std::pair<int, int> > >&&'
  659 |       vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
      |              ~~~~~~~~~^~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >; allocator_type = std::allocator<std::vector<std::pair<int, int> > >; std::false_type = std::false_type]'
  640 |       vector(vector&& __rv, const allocator_type& __m, false_type)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >; allocator_type = std::allocator<std::vector<std::pair<int, int> > >; std::true_type = std::true_type]'
  635 |       vector(vector&& __rv, const allocator_type& __m, true_type) noexcept
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:635:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >; std::__type_identity_t<_Alloc> = std::allocator<std::vector<std::pair<int, int> > >]'
  624 |       vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:624:28: note:   no known conversion for argument 1 from 'int' to 'const std::vector<std::vector<std::pair<int, int> > >&'
  624 |       vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
      |              ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >]'
  620 |       vector(vector&&) noexcept = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >]'
  601 |       vector(const vector& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >; size_type = long unsigned int; value_type = std::vector<std::pair<int, int> >; allocator_type = std::allocator<std::vector<std::pair<int, int> > >]'
  569 |       vector(size_type __n, const value_type& __value,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:569:47: note:   no known conversion for argument 2 from 'std::vector<std::pair<bool, int> >' to 'const std::vector<std::vector<std::pair<int, int> > >::value_type&' {aka 'const std::vector<std::pair<int, int> >&'}
  569 |       vector(size_type __n, const value_type& __value,
      |                             ~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >; size_type = long unsigned int; allocator_type = std::allocator<std::vector<std::pair<int, int> > >]'
  556 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:51: note:   no known conversion for argument 2 from 'std::vector<std::pair<bool, int> >' to 'const std::vector<std::vector<std::pair<int, int> > >::allocator_type&' {aka 'const std::allocator<std::vector<std::pair<int, int> > >&'}
  556 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |                             ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >; allocator_type = std::allocator<std::vector<std::pair<int, int> > >]'
  542 |       vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector() [with _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >]'
  531 |       vector() = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:531:7: note:   candidate expects 0 arguments, 2 provided