Language: C++

#include<iostream>
#include<string>
using namespace std;
bool solved[10000][100];
long long time[10000][100];
long long anstime[10000];
int main(){
	int m,t,p,r;
	while(true){
		cin>>m>>t>>p>>r;
		if(m==0&&t==0&&p==0&&r==0)
			break;
		for(int i=0;i<t;i++){
			anstime[i]=0;
			for(int j=0;j<p;j++){
				solved[i][j]=false;
				time[i][j]=0;
			}
		}
		for(int i=0;i<r;i++){
			int a[4];
			for(int j=0;j<4;j++)
				cin>>a[j];
			if(a[3]==0){
				solved[a[1]-1][a[2]-1]=true;
				anstime[a[1]-1]+=time[a[1]-1][a[2]-1]+a[0];
			}
			else
				time[a[1]-1][a[2]-1]+=20;
		}
		int b[100];
		for(int i=0;i<t;i++){
			int count=0;
			for(int j=0;j<p;j++)
				count+=solved[i][j];
			anstime[i]=count*1000-anstime[i];
			b[i]=i+1;
		}
		for(int i=0;i<t-1;i++){
			for(int j=t-1;j>i;j--){
				if(anstime[j]>anstime[j-1]||(anstime[j]==anstime[j-1]&&b[j]>b[j-1])){
					int tmp=anstime[j];
					anstime[j]=anstime[j-1];
					anstime[j-1]=tmp;
					tmp=b[j];
					b[j]=b[j-1];
					b[j-1]=tmp;
				}
			}
		}
		cout<<b[0];
		for(int i=1;i<t;i++){
			if(anstime[i]==anstime[i-1])
				cout<<'=';
			else
				cout<<',';
			cout<<b[i];
		}
		cout<<endl;
	}
	return 0;
}

Compiler output:
a.cc:5:26: error: 'long long int time [10000][100]' redeclared as different kind of entity
    5 | long long time[10000][100];
      |                          ^
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 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/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'int main()':
a.cc:17:39: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |                                 time[i][j]=0;
      |                                       ^
a.cc:17:42: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |                                 time[i][j]=0;
      |                                          ^
a.cc:17:43: error: assignment of read-only location '*(time + (((sizetype)i) + ((sizetype)j)))'
   17 |                                 time[i][j]=0;
      |                                 ~~~~~~~~~~^~
a.cc:26:61: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |                                 anstime[a[1]-1]+=time[a[1]-1][a[2]-1]+a[0];
      |                                                             ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:26:69: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |                                 anstime[a[1]-1]+=time[a[1]-1][a[2]-1]+a[0];
      |                                                                     ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:26:70: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |                                 anstime[a[1]-1]+=time[a[1]-1][a[2]-1]+a[0];
      |                                                  ~~~~~~~~~~~~~~~~~~~~^~~~~
a.cc:26:48: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |                                 anstime[a[1]-1]+=time[a[1]-1][a[2]-1]+a[0];
      |                                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:26:48: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'long long int' [-fpermissive]
   26 |                                 anstime[a[1]-1]+=time[a[1]-1][a[2]-1]+a[0];
      |                                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                |
      |                                                time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:29:44: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   29 |                                 time[a[1]-1][a[2]-1]+=20;
      |                                            ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:29:52: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   29 |                                 time[a[1]-1][a[2]-1]+=20;
      |                                                    ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:29:53: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   29 |                                 time[a[1]-1][a[2]-1]+=20;
      |                                 ~~~~~~~~~~~~~~~~~~~~^~~~
a.cc:29:53: error: assignment of read-only location '*(time + ((((sizetype)a[1]) + ((sizetype)a[2])) + 18446744073709551614))'