Language: C

#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}p;

P Q[LEN];
int head,tail,n;

void enqueue(P x){
  Q[tail]=x;
  tail=(tail+1)%LEN;
}
P dequeue(){
  P x=Q[head];
  head=(head+1)%LEN;
  return x;
}
int main(int a,int b){return a<b ? a:b;}

int main(){
  int elaps=0,c;
  int i,q;
  p u;
  scanf("%d%d",&n,&q);
  for(i=1;i<=n;i++){
    scanf("%s",Q[i].name);
    scanf("%d",&Q[i].t);
  }
  head=1;tail=n+1;

  while(head!=tail)
    u=depueue();
      c=main(q,u,t);
      u.t-=c;
      elaps+=c;
      if(u.t>0)enqueue(u);
      else{printf("%s,%d\n",u.name,elaps);
      }
      }
      return p;}



Compiler output:
main.c:10:1: error: unknown type name 'P'
   10 | P Q[LEN];
      | ^
main.c:13:14: error: unknown type name 'P'
   13 | void enqueue(P x){
      |              ^
main.c:17:1: error: unknown type name 'P'
   17 | P dequeue(){
      | ^
main.c: In function 'dequeue':
main.c:18:3: error: unknown type name 'P'
   18 |   P x=Q[head];
      |   ^
main.c: At top level:
main.c:24:5: error: redefinition of 'main'
   24 | int main(){
      |     ^~~~
main.c:22:5: note: previous definition of 'main' with type 'int(int,  int)'
   22 | int main(int a,int b){return a<b ? a:b;}
      |     ^~~~
main.c: In function 'main':
main.c:24:1: error: number of arguments doesn't match prototype
   24 | int main(){
      | ^~~
main.c:22:5: error: prototype declaration
   22 | int main(int a,int b){return a<b ? a:b;}
      |     ^~~~
main.c:30:20: error: request for member 'name' in something not a structure or union
   30 |     scanf("%s",Q[i].name);
      |                    ^
main.c:31:21: error: request for member 't' in something not a structure or union
   31 |     scanf("%d",&Q[i].t);
      |                     ^
main.c:36:7: error: implicit declaration of function 'depueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   36 |     u=depueue();
      |       ^~~~~~~
      |       dequeue
main.c:36:7: error: incompatible types when assigning to type 'p' {aka 'struct pp'} from type 'int'
main.c:37:18: error: 't' undeclared (first use in this function)
   37 |       c=main(q,u,t);
      |                  ^
main.c:37:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:37:16: error: incompatible type for argument 2 of 'main'
   37 |       c=main(q,u,t);
      |                ^
      |                |
      |                p {aka struct pp}
main.c:24:5: note: expected 'int' but argument is of type 'p' {aka 'struct pp'}
   24 | int main(){
      |     ^~~~
main.c:37:9: error: too many arguments to function 'main'
   37 |       c=main(q,u,t);
      |         ^~~~
main.c:24:5: note: declared here
   24 | int main(){
      |     ^~~~
main.c:40:16: error: implicit declaration of function 'enqueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   40 |       if(u.t>0)enqueue(u);
      |                ^~~~~~~
      |                dequeue
main.c: At top level:
main.c:44:7: error: expected identifier or '(' before 'return'
   44 |       return p;}
      |       ^~~~~~
main.c:44:16: error: expected identifier or '(' before '}' token
   44 |       return p;}
      |                ^