Language: C

#include<stdio.h>
#define MAX 100000
typedef struct{
    char name[100];
    int time;
} queue;
 
void enqu(queue);
queue dequ(void);
 
int head=0,tail=0;
queue C[MAX];
 
    main(){
    int n,m,i,sum=0;
    queue D[MAX];

    scanf("%d%d",&n,&m);
        for(i=0;i<n;i++){
            scanf("%s%d",D.name,&D.time);
            enqueue(D);
        }
        while(1){
            if(head == tail) break;
            if(D[head].time > m){
                m = dequ();
                D.time -= C;
                enqu(D);
                sum += m;
            }
            else{
                D = dequeue();
                printf("%s %d\n",D.name,D.time+sum);
                sum += D.time;
            }
        }
return 0;
}
 
void enqu(queue p){
C[tail] = p;
if(tail+1 == MAX) tail = 0;
else tail++;
}
 
queue dequ(){
    queue x;
    x = C[head];
 
    if(head+1 == MAX) head = 0;
    else head++;
    return x;
}

Compiler output:
main.c:14:5: error: return type defaults to 'int' [-Wimplicit-int]
   14 |     main(){
      |     ^~~~
main.c: In function 'main':
main.c:20:27: error: '(queue *)&D' is a pointer; did you mean to use '->'?
   20 |             scanf("%s%d",D.name,&D.time);
      |                           ^
      |                           ->
main.c:20:35: error: '(queue *)&D' is a pointer; did you mean to use '->'?
   20 |             scanf("%s%d",D.name,&D.time);
      |                                   ^
      |                                   ->
main.c:21:13: error: implicit declaration of function 'enqueue'; did you mean 'enqu'? [-Wimplicit-function-declaration]
   21 |             enqueue(D);
      |             ^~~~~~~
      |             enqu
main.c:26:21: error: incompatible types when assigning to type 'int' from type 'queue'
   26 |                 m = dequ();
      |                     ^~~~
main.c:27:18: error: '(queue *)&D' is a pointer; did you mean to use '->'?
   27 |                 D.time -= C;
      |                  ^
      |                  ->
main.c:28:22: error: incompatible type for argument 1 of 'enqu'
   28 |                 enqu(D);
      |                      ^
      |                      |
      |                      queue *
main.c:8:11: note: expected 'queue' but argument is of type 'queue *'
    8 | void enqu(queue);
      |           ^~~~~
main.c:32:21: error: implicit declaration of function 'dequeue'; did you mean 'dequ'? [-Wimplicit-function-declaration]
   32 |                 D = dequeue();
      |                     ^~~~~~~
      |                     dequ
main.c:32:19: error: assignment to expression with array type
   32 |                 D = dequeue();
      |                   ^
main.c:33:35: error: '(queue *)&D' is a pointer; did you mean to use '->'?
   33 |                 printf("%s %d\n",D.name,D.time+sum);
      |                                   ^
      |                                   ->
main.c:33:42: error: '(queue *)&D' is a pointer; did you mean to use '->'?
   33 |                 printf("%s %d\n",D.name,D.time+sum);
      |                                          ^
      |                                          ->
main.c:34:25: error: '(queue *)&D' is a pointer; did you mean to use '->'?
   34 |                 sum += D.time;
      |                         ^
      |                         ->