Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int> pii;
#define MAX 99999999
typedef struct{
    int time;
    int num;
    int qst;
    int judge;
}data;
typedef  pair<int, pair<int, int>>pi; //  seikai time number
int main(){
    int m,t,p,r;
    while(cin>>m>>t>>p>>r,m+t+r+p){
    vector<data>v;
    vvi team(60,vi(60,0));
    vvi lost(1000,vi(100,0));
    rep(i,r){
        data temp;
        cin>>temp.time>>temp.num>>temp.qst>>temp.judge; v.push_back(temp);
        if(!(v[i].judge)){
            team[v[i].num][v[i].qst]=1;
            lost[v[i].num][v[i].qst]+=v[i].time;
        }else{
            lost[v[i].num][v[i].qst]+=20;
        }
    }
    vector<pi>ans(100,pi(0,pii(-INF,0)));

    for(int i=1; i<=t;i++){
        ans[i].second.second=i;
        for(int j=1; j<=p;j++)
            if(team[i][j]){
                ans[i].first++; ans[i].second.first-=lost[i][j]; ans[i].second.second=i;
        }
    }
    sort(ans.begin()+1,ans.begin()+t+1,greater<pi>());
        rep(i,t){
            if(i){
                if(ans[i].first==ans[i+1].first&&ans[i].second.first==ans[i+1].second.first)
                    cout<<"=";
                else
                    cout<<",";
            }
            cout<<ans[i+1].second.second;
        }
        cout<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:16: error: template argument 1 is invalid
   41 |     vector<data>v;
      |                ^
a.cc:41:16: error: template argument 2 is invalid
a.cc:45:9: error: reference to 'data' is ambiguous
   45 |         data temp;
      |         ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:36:2: note:                 'typedef struct data data'
   36 | }data;
      |  ^~~~
a.cc:46:14: error: 'temp' was not declared in this scope
   46 |         cin>>temp.time>>temp.num>>temp.qst>>temp.judge; v.push_back(temp);
      |              ^~~~
a.cc:46:59: error: request for member 'push_back' in 'v', which is of non-class type 'int'
   46 |         cin>>temp.time>>temp.num>>temp.qst>>temp.judge; v.push_back(temp);
      |                                                           ^~~~~~~~~
a.cc:47:15: error: invalid types 'int[int]' for array subscript
   47 |         if(!(v[i].judge)){
      |               ^
a.cc:48:19: error: invalid types 'int[int]' for array subscript
   48 |             team[v[i].num][v[i].qst]=1;
      |                   ^
a.cc:48:29: error: invalid types 'int[int]' for array subscript
   48 |             team[v[i].num][v[i].qst]=1;
      |                             ^
a.cc:49:19: error: invalid types 'int[int]' for array subscript
   49 |             lost[v[i].num][v[i].qst]+=v[i].time;
      |                   ^
a.cc:49:29: error: invalid types 'int[int]' for array subscript
   49 |             lost[v[i].num][v[i].qst]+=v[i].time;
      |                             ^
a.cc:49:40: error: invalid types 'int[int]' for array subscript
   49 |             lost[v[i].num][v[i].qst]+=v[i].time;
      |                                        ^
a.cc:51:19: error: invalid types 'int[int]' for array subscript
   51 |             lost[v[i].num][v[i].qst]+=20;
      |                   ^
a.cc:51:29: error: invalid types 'int[int]' for array subscript
   51 |             lost[v[i].num][v[i].qst]+=20;
      |                             ^