Language: C++

#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
#define MAX 2000000
#define INFTY (1<<30)
struct Team{
  int id;
  int point;
  int showed;

  Team(int ia,int ib,int ic);
};
int H,team[MAX+1];
void swap(*a,*b){
  tmp=*a;
  *a=*b;
  *b=tmp;
}
void maxHeapify(int i){
  int l,r,largest;
  l=2*i;
  r=2*i+1;

  if(l<=H&&team[l].point>team[i].point){
    largest=l;
  }
  elsif(team[l].point==team[i].point){
    if(team[l].id<team[i].id){
      largest=l;
    }
  }
  else largest=i;
  if (r<=H&&team[r].point>team[largest].point){
    largest=r;
  }
  elsif(team[r].point==team[largest].point){
    if(team[r].id<team[largest]){
      largest=r;
    }
  }
  if(largest!=i){
    swap(team[i],team[largest]);
    maxHeapify(largest);
  }
}
int extract(team){
  int maxv;
  if(H<1) return -INFTY;
  maxv=team[1];
  team[1]=team[H--];
  maxHeapify(1);
  return maxv;
}
void IncreaseKey(int i,int key){
  team[i].point+=key;
  while(i>1&&team[i/2]<team[i]){
    swap(team[i],team[i/2]);
    i=i/2;
  }
}
void insert(int id){
  H++;
  team[H]=Team(id,0,0);
}
void show_top(team){
  top=0;
  for(int i=0;i<n;i++){
    if(team[i].showed>team[top].showed) top=i;
  }
  printf("%d\n",top);
}
  
int main(){
  int n,r,l;
  int d[1000000];
  int t[1000000];
  int x[1000000];
  scanf("%d%d%d",&n,&r,&l);
  for(int i=0;i<n;i++){
    insert(i);
  }
  for(int i=0;i<r;i++){
    scanf("%d%d%d",&d[i],&t[i],&x[i]);
    IncreaseKey(d[i],x[i]);
    top=extract(team);
    if(i>0){
    top.showed+=t[i]-t[i-1];
    }
  }
  show_top(team);
}
  

Compiler output:
a.cc:15:6: error: variable or field 'swap' declared void
   15 | void swap(*a,*b){
      |      ^~~~
a.cc:15:12: error: 'a' was not declared in this scope
   15 | void swap(*a,*b){
      |            ^
a.cc:15:15: error: 'b' was not declared in this scope
   15 | void swap(*a,*b){
      |               ^
a.cc: In function 'void maxHeapify(int)':
a.cc:25:20: error: request for member 'point' in 'team[l]', which is of non-class type 'int'
   25 |   if(l<=H&&team[l].point>team[i].point){
      |                    ^~~~~
a.cc:25:34: error: request for member 'point' in 'team[i]', which is of non-class type 'int'
   25 |   if(l<=H&&team[l].point>team[i].point){
      |                                  ^~~~~
a.cc:28:17: error: request for member 'point' in 'team[l]', which is of non-class type 'int'
   28 |   elsif(team[l].point==team[i].point){
      |                 ^~~~~
a.cc:28:32: error: request for member 'point' in 'team[i]', which is of non-class type 'int'
   28 |   elsif(team[l].point==team[i].point){
      |                                ^~~~~
a.cc:28:3: error: 'elsif' was not declared in this scope
   28 |   elsif(team[l].point==team[i].point){
      |   ^~~~~
a.cc:33:3: error: 'else' without a previous 'if'
   33 |   else largest=i;
      |   ^~~~
a.cc:34:21: error: request for member 'point' in 'team[r]', which is of non-class type 'int'
   34 |   if (r<=H&&team[r].point>team[largest].point){
      |                     ^~~~~
a.cc:34:41: error: request for member 'point' in 'team[largest]', which is of non-class type 'int'
   34 |   if (r<=H&&team[r].point>team[largest].point){
      |                                         ^~~~~
a.cc:37:17: error: request for member 'point' in 'team[r]', which is of non-class type 'int'
   37 |   elsif(team[r].point==team[largest].point){
      |                 ^~~~~
a.cc:37:38: error: request for member 'point' in 'team[largest]', which is of non-class type 'int'
   37 |   elsif(team[r].point==team[largest].point){
      |                                      ^~~~~
a.cc: At global scope:
a.cc:47:13: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   47 | int extract(team){
      |             ^~~~
      |             |
      |             int*
a.cc:47:18: error: expected ',' or ';' before '{' token
   47 | int extract(team){
      |                  ^
a.cc: In function 'void IncreaseKey(int, int)':
a.cc:56:11: error: request for member 'point' in 'team[i]', which is of non-class type 'int'
   56 |   team[i].point+=key;
      |           ^~~~~
a.cc: In function 'void insert(int)':
a.cc:64:11: error: cannot convert 'Team' to 'int' in assignment
   64 |   team[H]=Team(id,0,0);
      |           ^~~~~~~~~~~~
      |           |
      |           Team
a.cc: At global scope:
a.cc:66:6: error: variable or field 'show_top' declared void
   66 | void show_top(team){
      |      ^~~~~~~~
a.cc: In function 'int main()':
a.cc:86:5: error: 'top' was not declared in this scope
   86 |     top=extract(team);
      |     ^~~
a.cc:86:16: error: 'extract' cannot be used as a function
   86 |     top=extract(team);
      |         ~~~~~~~^~~~~~
a.cc:91:3: error: 'show_top' was not declared in this scope
   91 |   show_top(team);
      |   ^~~~~~~~