criyle/codenet-compile-errors huggingface dataset:
Language: C

#include <stdio.h>
#include <string.h>

#define LOOP_INIT 0
#define VER_INIT 0
#define P_NAME_MAX 10
#define P_NAME_INIT 0
#define QUEUE_MAX 100000
#define QUEUE_INIT 0
#define FIRST_ITEM 0
#define PROCESS_END -1
#define STACK_MAX 1000
#define TRUE 1
#define FALSE 0
#define EXIT_SUCCESS 0;
#define INF_LOOP while( 1 )
#define NEXT_ITEM( x ) ( ( x ) + 1 )

int main( void )
{
	struct st_process {
		unsigned char ubW_Dp_name[ P_NAME_MAX ];
		unsigned long ulW_Drem_time;
	};

	unsigned long ulW_Ddata_cnt = VER_INIT;
	unsigned long ulW_Dquantum = VER_INIT;
	unsigned long ulW_Dtotal_time = VER_INIT;
	unsigned long ulW_Cinput_loop_cnt = VER_INIT;
	unsigned long ulW_Cloop_cnt = VER_INIT;
	unsigned long ulW_Cend_cnt = VER_INIT;
	unsigned long ulW_Cstack_cnt = VER_INIT;
	unsigned long ulW_Dqueue_add_calc = VER_INIT;
	unsigned long ulW_Cqueue_loop_cnt = VER_INIT;
	unsigned char ubW_Fqueue_flag = VER_INIT;

	struct st_process queue[ QUEUE_MAX ];
	struct st_process process_stack[ STACK_MAX ];

	scanf( "%d %d", &ulW_Ddata_cnt, &ulW_Dquantum );
	for( ulW_Cinput_loop_cnt = LOOP_INIT; ulW_Cinput_loop_cnt < ulW_Ddata_cnt; ulW_Cinput_loop_cnt++ ){
		scanf( "%s", queue[ ulW_Cinput_cnt ].ubW_Dp_name );
		scanf( "%d", &queue[ ulW_Cinput_cnt ].ulW_Drem_time );
	}

	for( ulW_Cloop_cnt = LOOP_INIT; ulW_Cloop_cnt < ulW_Ddata_cnt + ulW_Cend_cnt; ulW_Cloop_cnt++ ){
		ubW_Fqueue_flag = FALSE;
		if( queue[ ulW_Cloop_cnt ].ulW_Drem_time <= ulW_Dquantum ){
			ulW_Dtotal_time += queue[ ulW_Cloop_cnt ].ulW_Drem_time;
			queue[ ulW_Cloop_cnt ].ulW_Drem_time = ulW_Dtotal_time;
			ubW_Fqueue_flag = TRUE;
		}
		else{
			ulW_Dtotal_time += ulW_Dquantum;
			queue[ ulW_Ddata_cnt + ulW_Cend_cnt ].ulW_Drem_time = queue[ ulW_Cloop_cnt ].ulW_Drem_time - ulW_Dquantum;
			strcpy( queue[ ulW_Ddata_cnt + ulW_Cend_cnt ].ubW_Dp_name, queue[ ulW_Cloop_cnt ].ubW_Dp_name );
			ulW_Cend_cnt++;
		}
		if( ubW_Fqueue_flag == FALSE ){
			queue[ ulW_Cloop_cnt ].ulW_Drem_time = PROCESS_END;
		}
		process_stack[ ulW_Cstack_cnt ] = queue[ ulW_Cloop_cnt ];
		if( process_stack[ ulW_Cstack_cnt ].ulW_Drem_time != PROCESS_END ){
			printf( "%s %d\n", process_stack[ NEXT_ITEM( ulW_Cstack_cnt ) ].ubW_Dp_name, process_stack[ NEXT_ITEM( ulW_Cstack_cnt ) ].ulW_Drem_time );
		}
		else{
		}
	}
	return EXIT_SUCCESS;
}

Compiler output:
main.c: In function 'main':
main.c:42:37: error: 'ulW_Cinput_cnt' undeclared (first use in this function); did you mean 'ulW_Cend_cnt'?
   42 |                 scanf( "%s", queue[ ulW_Cinput_cnt ].ubW_Dp_name );
      |                                     ^~~~~~~~~~~~~~
      |                                     ulW_Cend_cnt
main.c:42:37: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdlib.h>
#define N
int Q[];
void enqueue(int);
void dequeue(void);
int head=0,tail,n;
char name[100001][10];
int time[100001];

void dequeue(){
  int x;
  if(head+1 == n) head = 0;
  else head = head + 1;
}

void enqueue(int x){
  time[tail]=time[x];
  strcpy(name[tail],name[x]);
  if(head+1 == n) tail = 0;
  else tail++;
}


main(){
  int q,i,total=0;
  scanf("%d %d",&n,&q);
  for(tail=0;tail<n;tail++){
    scanf("%s %d",name[tail][],&time[tail]);
  }
  while(head != tail){
    time[head] -= q;
    if(time[head]>0){
      total += q;
      dequeue();
      if(head - 1 != -1) enqueue(head - 1);
      else enqueue(n-1);
    }
    else {
      total += time[head] + q;
      printf("%s %d\n",name[head],total);
      head++;
    } 
  }
  return 0;
}

Compiler output:
main.c: In function 'enqueue':
main.c:19:3: error: implicit declaration of function 'strcpy' [-Wimplicit-function-declaration]
   19 |   strcpy(name[tail],name[x]);
      |   ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strcpy'
    2 | #include<stdlib.h>
  +++ |+#include <string.h>
    3 | #define N
main.c:19:3: warning: incompatible implicit declaration of built-in function 'strcpy' [-Wbuiltin-declaration-mismatch]
   19 |   strcpy(name[tail],name[x]);
      |   ^~~~~~
main.c:19:3: note: include '<string.h>' or provide a declaration of 'strcpy'
main.c: At top level:
main.c:25:1: error: return type defaults to 'int' [-Wimplicit-int]
   25 | main(){
      | ^~~~
main.c: In function 'main':
main.c:29:30: error: expected expression before ']' token
   29 |     scanf("%s %d",name[tail][],&time[tail]);
      |                              ^
main.c: At top level:
main.c:4:5: warning: array 'Q' assumed to have one element
    4 | int Q[];
      |     ^
Language: C

#include<stdio.h>
#include<stdlib.h>

int head=0,tail,n;
rypedef struct{
  char name[100];
  int time;
}Process;

Process Q[1000000];
void enqueue(Process);
Process dequeue(void);

Process dequeue(Process x){
  tail++;  
  return Q[tail-1];
}

void enqueue(int x){
  Q[head]=x
    if(head+1 == n) head = 0;
    else head = head + 1;
}


main(){
  int q,i,total=0;
  Process x;
  scanf("%d %d",&n,&q);
  for(i=0;i<n;i++){
    scanf("%s %d",x.name,&x.time);
    enqueue(x);  
  }
  while(1){
    x = dequeue();
    if(x.t <=q){
      total += x.time;
      printf("%s %d\n",x.name,total);
    }
    else{
      x.time -=q;
      total+=q;
      enqueue(x);
    }
    if(head == tail)break;
  }
  return 0;
}

Compiler output:
main.c:5:8: error: expected ';' before 'struct'
    5 | rypedef struct{
      |        ^~~~~~~
      |        ;
main.c:10:1: error: unknown type name 'Process'
   10 | Process Q[1000000];
      | ^~~~~~~
main.c:11:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
   11 | void enqueue(Process);
      | ^~~~
main.c:12:1: error: unknown type name 'Process'
   12 | Process dequeue(void);
      | ^~~~~~~
main.c:14:1: error: unknown type name 'Process'
   14 | Process dequeue(Process x){
      | ^~~~~~~
main.c:14:17: error: expected declaration specifiers or '...' before 'Process'
   14 | Process dequeue(Process x){
      |                 ^~~~~~~
main.c: In function 'enqueue':
main.c:20:12: error: expected ';' before 'if'
   20 |   Q[head]=x
      |            ^
      |            ;
   21 |     if(head+1 == n) head = 0;
      |     ~~      
main.c:22:5: error: 'else' without a previous 'if'
   22 |     else head = head + 1;
      |     ^~~~
main.c: At top level:
main.c:26:1: error: return type defaults to 'int' [-Wimplicit-int]
   26 | main(){
      | ^~~~
main.c: In function 'main':
main.c:28:10: error: expected ';' before 'x'
   28 |   Process x;
      |          ^~
      |          ;
main.c:31:19: error: 'x' undeclared (first use in this function)
   31 |     scanf("%s %d",x.name,&x.time);
      |                   ^
main.c:31:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdlib.h>

int head=0,tail,n;
rypedef struct{
  char name[100];
  int time;
}Process;

Process Q[1000000];
void enqueue(Process);
Process dequeue(void);

Process dequeue(void){
  tail++;  
  return Q[tail-1];
}

void enqueue(Process x){
  Q[head]=x;
  if(head+1 == n) head = 0;
  else head = head + 1;
}


main(){
  int q,i,total=0;
  Process x;
  scanf("%d %d",&n,&q);
  for(i=0;i<n;i++){
    scanf("%s %d",x.name,&x.time);
    enqueue(x);  
  }
  while(1){
    x = dequeue();
    if(x.time <= q){
      total += x.time;
      printf("%s %d\n",x.name,total);
    }
    else{
      x.time -=q;
      total+=q;
      enqueue(x);
    }
    if(head == tail)break;
  }
  return 0;
}

Compiler output:
main.c:5:8: error: expected ';' before 'struct'
    5 | rypedef struct{
      |        ^~~~~~~
      |        ;
main.c:10:1: error: unknown type name 'Process'
   10 | Process Q[1000000];
      | ^~~~~~~
main.c:11:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
   11 | void enqueue(Process);
      | ^~~~
main.c:12:1: error: unknown type name 'Process'
   12 | Process dequeue(void);
      | ^~~~~~~
main.c:14:1: error: unknown type name 'Process'
   14 | Process dequeue(void){
      | ^~~~~~~
main.c:19:14: error: expected declaration specifiers or '...' before 'Process'
   19 | void enqueue(Process x){
      |              ^~~~~~~
main.c:26:1: error: return type defaults to 'int' [-Wimplicit-int]
   26 | main(){
      | ^~~~
main.c: In function 'main':
main.c:28:10: error: expected ';' before 'x'
   28 |   Process x;
      |          ^~
      |          ;
main.c:31:19: error: 'x' undeclared (first use in this function)
   31 |     scanf("%s %d",x.name,&x.time);
      |                   ^
main.c:31:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

struct pro{
		char proname[8];
		int protime;
		struct pro next;
		};
	typedef struct pro Pro;
	
int main(void){
	int n,q,i;
	char *proNum[100000];
	int cnt = 0;
	int tcnt = 0;
	Pro p;
	Pro head = {"",0,p};
	
	scanf("%d %d",&n,&q);
	
	for( i = 0; i < n-1; i++){
		
		scanf("%s %d",p.proname,p.protime);
		p.next = ++p;
	};
	
	scanf("%s %d",p.protime, p.proname);
	p.next = head.next;
	
	while( cnt < n ){
		
		p = head.next;
		if(p.protime = 0){
			
			p = p.next;
		}else if(p.protime > q){
			
			p.protime -= q;
			tcnt += q;
		}else if (p.protime <= q){
			
			p.protime = 0;
			tcnt += p.protime;
			printf("%s %d\n", p.proname, tcnt);
			cnt++;
		}
	}
	return 0;
	
}

Compiler output:
main.c:6:28: error: field 'next' has incomplete type
    6 |                 struct pro next;
      |                            ^~~~
main.c: In function 'main':
main.c:23:26: error: wrong type argument to increment
   23 |                 p.next = ++p;
      |                          ^~
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 min(int a, int b) 
{
    return a < b ? a : b;
    
}

int main() 
{
    int elaps = 0, c;
    int i, q;
    P u;
    scanf("%d %d", &n, &time);

    /*??¨??????????????????????????\??????????????????????????????*/

    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 = dequeue();
        c = min(q, u.t);
        u.t -= c;
        elaps += c;
        if (u.t > 0) {
            enqueue(u);
            
        } else {
            printf("%s %d\n", u.name, elaps);
            
        }
        }
        return 0;
        
 }

Compiler output:
main.c: In function 'main':
main.c:39:25: error: 'time' undeclared (first use in this function)
   39 |     scanf("%d %d", &n, &time);
      |                         ^~~~
main.c:3:1: note: 'time' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
    2 | #include <string.h>
  +++ |+#include <time.h>
    3 | #define LEN 100005
main.c:39:25: note: each undeclared identifier is reported only once for each function it appears in
   39 |     scanf("%d %d", &n, &time);
      |                         ^~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#include <string.h>

struct Queue {
  int time;
  char name[7];
  Queue *next;
};

void push(int a, char nam[7]);

struct Queue *top = NULL, *bot = NULL;

int main(void){
int n, i, num, ans = 0, tmp;
char str[7];
scanf("%d %d",&n, &num);
for (i=0;i<n;i++) {
scanf("%s %d",str,&tmp);
push(tmp,str);
}
while(bot != NULL) {
if(bot->time <= num) {
ans += bot->time;
printf("%s %d?\n",bot->name,ans);
bot = bot.next;
} else {
ans += num;
bot->time -= num;
push(bot->time,bot->name);
bot = bot.next;
}}
return 0;
}

void push(int a, char nam[7]){
struct Queue *new;
new = (struct Queue *)malloc(sizeof(struct Queue));
new->time = a;
strcpy(nam,new->name);
new->next = NULL;
top->next = new;
top = new;
}

Compiler output:
main.c:8:3: error: unknown type name 'Queue'
    8 |   Queue *next;
      |   ^~~~~
main.c: In function 'main':
main.c:27:10: error: 'bot' is a pointer; did you mean to use '->'?
   27 | bot = bot.next;
      |          ^
      |          ->
main.c:32:10: error: 'bot' is a pointer; did you mean to use '->'?
   32 | bot = bot.next;
      |          ^
      |          ->
main.c: In function 'push':
main.c:43:11: error: assignment to 'int *' from incompatible pointer type 'struct Queue *' [-Wincompatible-pointer-types]
   43 | top->next = new;
      |           ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include <string.h>

struct Queue {
  int time;
  char name[7];
  struct Queue *next;
};

void push(int a, char nam[7]);

struct Queue *top = NULL, *bot = NULL;

int main(void){
int n, i, num, ans = 0, tmp;
char str[7];
scanf("%d %d",&n, &num);
for (i=0;i<n;i++) {
scanf("%s %d",str,&tmp);
push(tmp,str);
}
while(bot != NULL) {
if(bot->time <= num) {
ans += bot->time;
printf("%s %d?\n",bot->name,ans);
bot = bot.next;
} else {
ans += num;
bot->time -= num;
push(bot->time,bot->name);
bot = bot.next;
}}
return 0;
}

void push(int a, char nam[7]){
struct Queue *new;
new = (struct Queue *)malloc(sizeof(struct Queue));
new->time = a;
strcpy(nam,new->name);
new->next = NULL;
top->next = new;
top = new;
}

Compiler output:
main.c: In function 'main':
main.c:27:10: error: 'bot' is a pointer; did you mean to use '->'?
   27 | bot = bot.next;
      |          ^
      |          ->
main.c:32:10: error: 'bot' is a pointer; did you mean to use '->'?
   32 | bot = bot.next;
      |          ^
      |          ->
Language: C

#include <stdio.h>
#include <string.h>
typedef struct{
  char name[10];
  int time;
}Process;
void enqueue(Process);
Process dequeue(void);
int n;
int head = 0;
int tail = 0;
Process p[100001];
int main(){
  int i,q,takenTime;
  Process x;

  scanf("%d %d",&n,&q);
  for(i=0;i<n;i++){
    scanf("%s %d",x.name,&x.time);
    enqueue(x);
  }
  takenTime = 0;
  while( head != tail ){
    x = dequeue();
    if( (x.time - q) > 0 ){
      takenTime += q;
      enqueue(x);
    }
    else {
      takenTime += x.time;
      printf("%s %d\n",x.name,x.time);
    }
  }
  return 0;
}
void enqueue(Process x){
  p[tail] = x;
  if( (tail+1) > n){
    tail = 0;
  }
  else {
    tail++;
  }
}
Process denqueue(void){
  if( (head+1) > n ){
    head = 0;
  }
  else {
    head++;
  }
  return p[head];
}

Compiler output:
/usr/bin/ld: /tmp/cc4mFzTG.o: in function `main':
main.c:(.text+0x85): undefined reference to `dequeue'
collect2: error: ld returned 1 exit status
Language: C

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

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

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

void initialize(void){

  head = tail = 0;
}

int Empty(void){
  
  if(head == tail){
    return 1;
  }
  else return 0;
}

int isFull(void){

  if(head == (tail + 1) % LEN){
    return 1;
  }
  else return 0;
}

void enqueue(P x){
  
  if(isFull()){
    fprintf(stderr,"Overflow\n");
    exit(1);
  }
  Q[tail] = x;
  if(tail + 1 == LEN){
    tail == 0;
  }
  else 
    tail++;
}

P dequeue(){
  P x;

  if(isEmpty()){
    fprintf(stderr,"Underflow\n");
    x = Q[head];
    if(head + 1 == LEN){
      head = 0;
    }
    else 
      head ++;
    return x;
  }
}


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);
  }

  
  return 0;
}

Compiler output:
main.c: In function 'dequeue':
main.c:52:6: error: implicit declaration of function 'isEmpty'; did you mean 'Empty'? [-Wimplicit-function-declaration]
   52 |   if(isEmpty()){
      |      ^~~~~~~
      |      Empty
Language: C

  char name[100];
  int t;
}P;
 
P Q[LEN+1];
int head, tail, n;
 
void enqueue(P x){
  Q[tail]=x;
  if(tail + 1 == MAX)
    tail=0;
  else
    tail++;
}
 
P dequeue(void){
  P x;
  x=Q[head];
  if(head+1 == MAX)
    head=0;
  else head++;
  return x;
}
 
 
int main(){
  int elaps = 0, c;
  int i, q;
  P p;
  scanf("%d %d", &n, &q);
 
  for ( i = 0; i < n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }
    head = 0;
    tail = n;

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

Compiler output:
main.c:3:1: error: expected identifier or '(' before '}' token
    3 | }P;
      | ^
main.c:3:2: warning: data definition has no type or storage class
    3 | }P;
      |  ^
main.c:3:2: error: type defaults to 'int' in declaration of 'P' [-Wimplicit-int]
main.c:5:1: error: unknown type name 'P'
    5 | P Q[LEN+1];
      | ^
main.c:5:5: error: 'LEN' undeclared here (not in a function)
    5 | P Q[LEN+1];
      |     ^~~
main.c:8:14: error: expected declaration specifiers or '...' before 'P'
    8 | void enqueue(P x){
      |              ^
main.c:16:1: error: unknown type name 'P'
   16 | P dequeue(void){
      | ^
main.c: In function 'dequeue':
main.c:17:4: error: expected ';' before 'x'
   17 |   P x;
      |    ^~
      |    ;
main.c:18:3: error: 'x' undeclared (first use in this function)
   18 |   x=Q[head];
      |   ^
main.c:18:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:16: error: 'MAX' undeclared (first use in this function)
   19 |   if(head+1 == MAX)
      |                ^~~
main.c: In function 'main':
main.c:29:4: error: expected ';' before 'p'
   29 |   P p;
      |    ^~
      |    ;
main.c:30:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   30 |   scanf("%d %d", &n, &q);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 |   char name[100];
main.c:30:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   30 |   scanf("%d %d", &n, &q);
      |   ^~~~~
main.c:30:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:40:7: error: 'p' undeclared (first use in this function)
   40 |       p = dequeue();
      |       ^
main.c:45:17: error: implicit declaration of function 'enqueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   45 |       if(p.t>0) enqueue(p);
      |                 ^~~~~~~
      |                 dequeue
main.c:46:12: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   46 |       else printf("%s %d\n",p.name,elaps);
      |            ^~~~~~
main.c:46:12: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:46:12: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:46:12: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

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

void enqueue(P);
P enqueue(void);
int min(int ,int);

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

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

void enqueue(P x){
  Q[tail] = x;
  tail++;
}

P dequeue(){
  head++;
  return Q[head-1];
}

int min(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 = dequeue();
    c = min(q,u.t);
    u.t -= c;
    elaps +=c;

    if(u.t > 0){
      enqueue(u);
    }

    else printf("%s  %d\n",u.name,elaps);
  }
  
  return 0;
}

Compiler output:
main.c:5:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
    5 | void enqueue(P);
      | ^~~~
main.c:6:1: error: unknown type name 'P'
    6 | P enqueue(void);
      | ^
main.c:6:3: error: conflicting types for 'enqueue'; have 'int(void)'
    6 | P enqueue(void);
      |   ^~~~~~~
main.c:5:6: note: previous declaration of 'enqueue' with type 'void()'
    5 | void enqueue(P);
      |      ^~~~~~~
main.c: In function 'main':
main.c:52:7: error: too many arguments to function 'enqueue'
   52 |       enqueue(u);
      |       ^~~~~~~
main.c:6:3: note: declared here
    6 | P enqueue(void);
      |   ^~~~~~~
Language: C

#include<stdio.h>
#include<string.h>
#define LEN 100005
typedef struct pp{
  char name[100];
  int t;
}P;

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

void initialize(){
  head=tail=0;
}

int isEmpty(){
  if(head==tail)
    return 0;
  else
    return 1;
}

int isFull(){
  if(head==(tail+1)%LEN)
    return 0;
  else;
  return 1;
}

void enqueue(P x){
  if(isFull(x)==0)
   printf("??¨?????????????????????????????????\n");
  Q[tail]=x;
  if(tail+1==LEN)
    tail=0;
    else
      tail++;
}

P dequeue(){
  P x;
  if(isEmpty()==0)
    printf("??¨?????????????????????????????????\n");
  x=Q[head];
  if(head+1==LEN)
    head=0;
  else
    head++;
  return x;
}


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);
  }
  initialize();
  head=1;
  tail=n+1;
  while(tail!=head){
    if(Q[head].t >q)
{
      elaps+=q;
      Q[head].t-=q;
      enqueue(dequeue());
   }
else
  {
      elaps+=Q[head].t;
      dequeue();
      printf("%s %d\n",Q[head-1].name,elaps);
    }
  }
    return 0;

Compiler output:
main.c: In function 'main':
main.c:80:5: error: expected declaration or statement at end of input
   80 |     return 0;
      |     ^~~~~~
Language: C

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

void enqueue(P);
P enqueue(void);
int min(int ,int);

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

P Q[LEN+1];
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 min(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 = dequeue();
    c = min(q,u.t);
    u.t -= c;
    elaps +=c;

    if(u.t > 0){
      enqueue(u);
    }

    else printf("%s  %d\n",u.name,elaps);
  }
  
  return 0;
}

Compiler output:
main.c:5:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
    5 | void enqueue(P);
      | ^~~~
main.c:6:1: error: unknown type name 'P'
    6 | P enqueue(void);
      | ^
main.c:6:3: error: conflicting types for 'enqueue'; have 'int(void)'
    6 | P enqueue(void);
      |   ^~~~~~~
main.c:5:6: note: previous declaration of 'enqueue' with type 'void()'
    5 | void enqueue(P);
      |      ^~~~~~~
main.c: In function 'main':
main.c:53:7: error: too many arguments to function 'enqueue'
   53 |       enqueue(u);
      |       ^~~~~~~
main.c:6:3: note: declared here
    6 | P enqueue(void);
      |   ^~~~~~~
Language: C

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define LEN 100005
 
typedef struct{
  char name[100];
  int t;
}P;

void enqueue(P);
P dequeue(void);

P Q[LEN+1];
int head=0,tail=0,n;
 
int main(){
  int elaps = 0;
  int i,q,sum;
  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 = dequeue();
      if( u.t <= q && u.t != 0)
	{
	  elaps = elaps + u.t;
	  printf("%s %d\n",u.name,elaps);
	}
      else if( u.t > q)
	{
	  u.t = u.t - q;
	  enqueue(u);
	  elaps = elaps + q;
	}
    }

  return 0;
}

void enqueue(P x)
{
  Q[tail] = x;
  if( tail + 1 == MAX )
    tail = 0;
  else 
    tail++;
  printf("%d %d\n",tail,x.t);
}

P dequeue()
{
  P x;
  x = Q[head];
  if( head + 1 == MAX )
    head = 0;
  else   
    head++;
  return x;
}

Compiler output:
main.c: In function 'enqueue':
main.c:53:19: error: 'MAX' undeclared (first use in this function)
   53 |   if( tail + 1 == MAX )
      |                   ^~~
main.c:53:19: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'dequeue':
main.c:64:19: error: 'MAX' undeclared (first use in this function)
   64 |   if( head + 1 == MAX )
      |                   ^~~
Language: C

#include<stdio.h>

void enqueue(int );
int dequeue();
int time[1000];
char name[1000][10];
int head=0,tail=0,n,q;

int main(){
  int i,total=0,flag=1;
  
  // input
  scanf("%d%d",&n,&q);
  for(i=0;i<n;i++){
    scanf("%s%d",name[i],&time[i]);
  }
  
  // execute
  while(1){
    flag = 0;
    for(i=0;i<n;i++){
      if(time[i] <= 100 && time[i] > 0){
	total += time[i];
	time[i] = 0;
	printf("%s %d\n",name[i],total);
      }
      else if(time[i] > 100){
	total += 100;
	time[i] -= 100;
	flag = 1;
      }
    }
    if(flag == 0) break;
  }
  
  
  return 0;

Compiler output:
main.c: In function 'main':
main.c:37:3: error: expected declaration or statement at end of input
   37 |   return 0;
      |   ^~~~~~
Language: C

#include<stdio.h>
#define N 100000
#define n 10
typedef struct{
 char name[n];
  int time;
}Queue;
Queue A[N];
int h=0,t=0;
void Enqueue(Queue);
Queue Dequeue(void);

int main()
{
  int n,q;
  int i,T=0;
  Queue j;
  scanf("%d%d",&n,&q);
  for(i=0;i<n;i++){
    scanf("%s%d",j.name,&j.time);
    Enqueue(j);
  }
  while(n>0){
    j=Dequeue();
    if(j.time>q){
      j.time=j.time-q; 
      T+=q;
      Enqueue(j);
    } 
    else{
      T+=j.time;
      printf("%s %d\n",j.name,T);
      n--;
    }
  }
  return 0;
}
void Enqueue(Queue J){ 
    A[t]=J;
    t++;
}
Queue Dequeue(void){
  return A[h++];
}

Compiler output:
main.c: In function 'main':
main.c:3:11: error: expected identifier or '(' before numeric constant
    3 | #define n 10
      |           ^~
main.c:15:7: note: in expansion of macro 'n'
   15 |   int n,q;
      |       ^
main.c:18:16: error: lvalue required as unary '&' operand
   18 |   scanf("%d%d",&n,&q);
      |                ^
main.c:18:20: error: 'q' undeclared (first use in this function)
   18 |   scanf("%d%d",&n,&q);
      |                    ^
main.c:18:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:8: error: lvalue required as decrement operand
   33 |       n--;
      |        ^~
Language: C

#include<stdio.h>
#define N 10000
#define s 100
typedef struct{
 char name[s];
  int time;
}Q;
Q A[N+1];
int h,t;
void Enq(Q);
Q Deq(void);
int main()
{
  int n,q;
  int i,T=0;
  Q j;
  scanf("%d%d",&n,&q);
  for(i=0;i<n;i++){
    scanf("%s%d",j.name,&j.time);
    Enq(j);
  }
  while(n>0){
    j=deq();
    if(j.time>q){
      j.time=j.time-q; 
      T+=q;
      Enq(j);
    } 
    else{
      T+=j.time;
      printf("%s %d\n",j.name,T);
      n--;
    }
  }
  return 0;
}
void Enq(Q J){ 
  if(N==t) t=0;
  A[t]=J;
  t++;
}
Q Deq(void){
  if(h==N) h=0;
  return a[h++];
}

Compiler output:
main.c: In function 'main':
main.c:23:7: error: implicit declaration of function 'deq'; did you mean 'Deq'? [-Wimplicit-function-declaration]
   23 |     j=deq();
      |       ^~~
      |       Deq
main.c:23:7: error: incompatible types when assigning to type 'Q' from type 'int'
main.c: In function 'Deq':
main.c:44:10: error: 'a' undeclared (first use in this function)
   44 |   return a[h++];
      |          ^
main.c:44:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#define N 10000
#define s 100
typedef struct{
 char name[s];
  int time;
}Q;
Q A[N+1];
int h,t;
void Enq(Q);
Q Deq(void);
int main()
{
  int n,q;
  int i,T=0;
  Q j;
  scanf("%d%d",&n,&q);
  for(i=0;i<n;i++){
    scanf("%s%d",j.name,&j.time);
    Enq(j);
  }
  while(n>0){
    j=deq();
    if(j.time>q){
      j.time=j.time-q; 
      T+=q;
      Enq(j);
    } 
    else{
      T+=j.time;
      printf("%s %d\n",j.name,T);
      n--;
    }
  }
  return 0;
}
void Enq(Q J){ 
  if(N==t) t=0;
  A[t]=J;
  t++;
}
Q Deq(void){
  if(h==N) h=0;
  return A[h++];
}

Compiler output:
main.c: In function 'main':
main.c:23:7: error: implicit declaration of function 'deq'; did you mean 'Deq'? [-Wimplicit-function-declaration]
   23 |     j=deq();
      |       ^~~
      |       Deq
main.c:23:7: error: incompatible types when assigning to type 'Q' from type 'int'
Language: C

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

void enqueue(char *);
char dequeue(void);
int min(int,int);
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 min(int a,int b){
  if(a < b) return a;
  else return 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 = dequeue();
    c = min(q,u.t);
    u.t -= c;
    elaps +=c;

    if(u.t > 0){
      enqueue(u);
    }

    else printf("%s  %d\n",u.name,elaps);
  }
  
  return 0;
}

Compiler output:
main.c:16:6: error: conflicting types for 'enqueue'; have 'void(P)' {aka 'void(struct pp)'}
   16 | void enqueue(P x){
      |      ^~~~~~~
main.c:5:6: note: previous declaration of 'enqueue' with type 'void(char *)'
    5 | void enqueue(char *);
      |      ^~~~~~~
main.c:21:3: error: conflicting types for 'dequeue'; have 'P()' {aka 'struct pp()'}
   21 | P dequeue(){
      |   ^~~~~~~
main.c:6:6: note: previous declaration of 'dequeue' with type 'char(void)'
    6 | char dequeue(void);
      |      ^~~~~~~
Language: C

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

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

void enqueue(P);
P dequeue(void);
int min(int,int);

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

void enqueue(P x){
  Q[tail] = x;
  tail = tail + 1;
}

P dequeue(){
  x = Q[head];
  head = head + 1;
  return x;
}

int min(int a,int b){
  if(a < b) return a;
  else return 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 = dequeue();
    c = min(q,u.t);
    u.t -= c;
    elaps +=c;

    if(u.t > 0){
      enqueue(u);
    }

    else printf("%s %d\n",u.name,elaps);
  }
  
  return 0;
}

Compiler output:
main.c: In function 'dequeue':
main.c:23:3: error: 'x' undeclared (first use in this function)
   23 |   x = Q[head];
      |   ^
main.c:23:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdlib.h>

#define MAX 100000

typedef struct{
  char name[10];
  int time;
} data;

void initialize(void);
int isEmpty(void);
int isFull(void);
void enqueue(data);
data dequeue(void);

int head,tail,n;
data Q[MAX+1];

int main(){
  int q,i,t;
  data d;

  scanf("%d %d",&n,&q);
  for(i=0;i<n;i++){
    scanf("%s %d",Q[i].name,&Q[i].time);
  }

  initialize();

  tail=n;

  while(head!=tail){
    d=dequeue();

    if(d.time<=q){
      t=d.time;
      printf("%s %d\n",d.name,d.time);
    }else if(d.time>q){
      t=q;
      d.time-=q;
      equeue(d);
    }
  }

  return 0;
}
  
    
void initialize(void){
  head=tail=0;
}

int isEmpty(void){
  if(head==tail){
    return 0; //empty
  }else{
    return 1;
  }
}

int isFull(void){
  if(head==((tail+1)%MAX)){
    return 1; //full
  }else{
    return 0;
  }
}

 void enqueue(data x){
  int full;

  full=isFull();
  if(full==1){
    fprintf(stderr,"overflow\n");
  }

  Q[tail]=x;

  if(tail+1==MAX){
    tail=0;
  }else{
    tail++;
  }
}

data dequeue(void){
  int emp;
  data x=Q[head];

  emp=isEmpty();
  if(emp==0){
    fprintf(stderr,"underflow\n");
  }

  x=Q[head];

  if(head+1==MAX){
    head=0;
  }else{
    head++;
  }

  return x;
}

Compiler output:
main.c: In function 'main':
main.c:42:7: error: implicit declaration of function 'equeue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   42 |       equeue(d);
      |       ^~~~~~
      |       dequeue
Language: C

#define N 100000
#include<stdio.h>

typedef struct{
  char name[10];
  int  time;
  int  flag;
}da_ta;

typedef struct{
  da_ta data[N];
  int  head;
  int  tail;
} queue;

void initialize(queue*,int);
void enqueue(queue*,da_ta);

int  main(){
  int cnt=0,i,n,q,tim=0;
  queue Q;


  scanf("%d %d",&n,&q);
  initialize(&Q,n);

  for(i=0;i<n;i++){
    scanf("%s %d",Q.data[i].name,&Q.data[i].time);
    enqueue(&Q,Q.data[i]);
  }

  i=0;
  while(1){
    if(cnt==n) break;
    if(Q.data[i].flag==1){
      i++;
      if(i==Q.tail) i=0;
      continue;
    }
    if((Q.data[i].time-q)<=0){
      tim+=Q.data[i].time;
      Q.data[i].flag=1;
      printf("%s %d\n",Q.data[i].name,tim);
      cnt++;
    }
    else{
      tim+=q;
      Q.data[i].time-=q;
    }
    i++;
    if(i==Q.tail) i=0;
  }

Compiler output:
main.c: In function 'main':
main.c:52:3: error: expected declaration or statement at end of input
   52 |   }
      |   ^
Language: C

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define MAX 100000

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

P Q[MAX+1];
int head = 0, tail, n;

void enqueue(P x);
P dequeue(void);
/*int isEmpty(void);
  int isFull(void);*/

int main(){
  int elaps = 0, c, t = 0;
  int i, q;
  P u;
  scanf("%d %d", &n, &q);

  for ( i = 0; i < n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }

  tail = i;

  for(i = 0;i < MAX; i++){

    t = Q[i].t - q;

    if(t  > 0){

      Q[i].t = t;
      elaps += q;
      u = dequeue();
      enqueue(u);
    }
    else if(t <= 0){

      elaps += Q[i].t;
      u = dequeue();
      printf("%s %d\n",u.name,elaps);
    }
  } 
}
return 0;
}

void enqueue(P x){
  /*if(isFull() == 1){
    exit(1);
    }else{*/
  Q[tail] = x;
  tail++;
  // }
}

P dequeue(){
  /*if(isEmpty() == 1){
    exit(1);
    }else{*/
  head++;
  return Q[head-1];
  //}
}

/*int isEmpty(){
  if(head == tail) return 1;
  else return 2;
  }

  int isFull(){
  if(head == ((tail+1)%MAX)) return 1;
  else return 2;
  }*/

Compiler output:
main.c:51:1: error: expected identifier or '(' before 'return'
   51 | return 0;
      | ^~~~~~
main.c:52:1: error: expected identifier or '(' before '}' token
   52 | }
      | ^
Language: C

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

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

void enqueue(P);
P dequeue(void);

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

void enqueue(P x){
  Q[head] = x;
  head++;
}

P dequeue(){
  tail++;
  return Q[tail-1];
}

int main(){
  int sum_time = 0;
  int i, q;
  P u;
  scanf("%d %d", &n, &q);

  for ( i = 0 ; i < n ; i++ ){
    scanf("%s", u.name);
    scanf("%d", &u[.t);
    enqueue(u);
  }

  while(head - tail != 0){
    u = dequeue();
    if( u.t <= q ) {
      sum_time += u.t;
      printf("%s %d\n",u.name,sum_time);
    }
    else{
      u.t -= q;
      sum_time += q;
      enqueue(u);
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:34:20: error: expected expression before '.' token
   34 |     scanf("%d", &u[.t);
      |                    ^
Language: C

#include <stdio.h>

#define N 100000
#define Q 1000

void enq1(int);
int deq1(void);
void enq2(int);
int deq2(void);

int head=0,tail=0,p;
int S1[N],S2[N];

int main(){

  int n,q,i,T=0,a,b,c=0;
  char name[N][10];
  int time[N];

  scanf("%d %d",&n,&q);

  for(i=0 ; i<n ; i++){
    scanf("%s %d",name[i],&time[i]);
    enq1(time[i]);
    enq2(i);
  }


  while(1){
    a=deq1();
    b=deq2();

    if(head==N) head=0;
    if(tale==0) tale=0;

    if(a-q<=0){
      T+=a;
      printf("%s %d\n",name[b],T);
      c++;
      if(c==n) break;
    }
    else{
      T+=q;
      a-=q;
      enq1(a);
      enq2(b);
    }
  }

  return 0;
}

void enq1(int n){
  S1[tail]=n;
  tail++;
}

int deq1(){
  head++;
  return S1[head-1];
}

void enq2(int n){
  S2[tail]=n;
  tail++;
}

int deq2(){
  head++;
  return S2[head-1];
}

Compiler output:
main.c: In function 'main':
main.c:34:8: error: 'tale' undeclared (first use in this function)
   34 |     if(tale==0) tale=0;
      |        ^~~~
main.c:34:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#define MAX 100000
typedef struct{
  char name[10];
  int time;
}process;
void enqueue(process);
process dequeue(void);
int head=0,tail=0,q;
process p[MAX];

int main()
{
  process x;
  int n,i,t=0;

  scanf("%d%d",&n,&q);
  for(i=0; i<n; i++)  {
    scanf("%s%d",x.name,&x.time);
    enqueue(x);
  }

  while(head!=tail) {
    if(p[head].time > q) {
      p[head].time = p[head].time-q;
      t += q;
      enqueue(dequeue());
    }
    else if(p[head].time <= q) {
      t += p[head].time;
      printf("%s %d\n",p[head].name,t);
      dequeue();
    }
  }
    
  return 0;
}

void enqueue(process x)
{
  p[tail] = x;
  if(tail+1 == MAX-1) tail = 0;
  else tail++;
}

Compiler output:
/usr/bin/ld: /tmp/ccjggKEH.o: in function `main':
main.c:(.text+0xe9): undefined reference to `dequeue'
/usr/bin/ld: main.c:(.text+0x180): undefined reference to `dequeue'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int head=0;
int tail;
int Q[100000];


void initiaize(void);
int isEmpty(void);
int isFull(void);
int dequeue(int );
void enqueue(int ,int );

int main(){
	int n,q,i;
	int count=0,extend;
	scanf("%d%d",&n,&q);
	char name[n][10];
	char name2[n][10];
	int Q2[n];
	tail=n;
	for(i=0;i<n;i++){
		scanf("%s",name[i]);
		scanf("%d",&Q[i]);
	}
	i=0;
	while(1){
		if(i==n)break;
		extend=dequeue(n);
		if(extend<=q){
			count+=extend;
			Q2[i]=count;
			if(head==0)strcpy(name2[i],name[7]);
			else strcpy(names[i],name[head-1]);
			i++;
		}
		else{
			count+=q;
			extend-=q;
			if(head==0)strcpy(name[tail],name[7]);
			else strcpy(name[tail],name[head-1]);
			enqueue(extend,n);
		}
	}	
	for(i=0;i<n;i++){
		printf("%s",name2[i]);
		printf("%d",&Q2[i]);
	}
	return 0;
}



void initiaize(){
	head=0;
	tail=0;
}


int isEmpty(){
	if(head == tail)return 1;
	else return 0;
}

int isFull(){
	if(head == (tail+1)% 100000)return 1;
	else return 0;
}

void enqueue(int x,int n){
	if(isFull()==1)exit(0);
	Q[tail]=x;
	if(tail+1==n)tail=0;
	else tail++;
}



int dequeue(int n){
	int x;
	if(isEmpty==1)exit(1);
	x=Q[head];
	if(head+1==n)head=0;
	else head++;
	return x;
}

Compiler output:
main.c: In function 'main':
main.c:36:37: error: 'names' undeclared (first use in this function); did you mean 'name2'?
   36 |                         else strcpy(names[i],name[head-1]);
      |                                     ^~~~~
      |                                     name2
main.c:36:37: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'dequeue':
main.c:83:19: warning: comparison between pointer and integer
   83 |         if(isEmpty==1)exit(1);
      |                   ^~
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int head=0;
int tail;
int Q[100000];


void initiaize(void);
int isEmpty(void);
int isFull(void);
int dequeue(int );
void enqueue(int ,int );

int main(){
	int n,q,i;
	int count=0,extend;
	scanf("%d%d",&n,&q);
	char name[n][10];
	tail=n;
	for(i=0;i<n;i++){
		scanf("%s",name[i]);
		scanf("%d",&Q[i]);
	}
	i=0;
	while(1){
		if(i==n)break;
		extend=dequeue(n);
		if(extend<=q){
			count+=extend;
			Q2[i]=count;
			if(head==0)printf("%s %d\n",name[7],count);
			else printf("%s %d\n",name[head-1],count);
			i++;
		}
		else{
			count+=q;
			extend-=q;
			if(head==0)strcpy(name[tail],name[7]);
			else strcpy(name[tail],name[head-1]);
			enqueue(extend,n);
		}
	}	

	return 0;
}



void initiaize(){
	head=0;
	tail=0;
}


int isEmpty(){
	if(head == tail)return 1;
	else return 0;
}

int isFull(){
	if(head == (tail+1)% 100000)return 1;
	else return 0;
}

void enqueue(int x,int n){
	if(isFull()==1)exit(0);
	Q[tail]=x;
	if(tail+1==n)tail=0;
	else tail++;
}



int dequeue(int n){
	int x;
	if(isEmpty==1)exit(1);
	x=Q[head];
	if(head+1==n)head=0;
	else head++;
	return x;
}

Compiler output:
main.c: In function 'main':
main.c:32:25: error: 'Q2' undeclared (first use in this function); did you mean 'Q'?
   32 |                         Q2[i]=count;
      |                         ^~
      |                         Q
main.c:32:25: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'dequeue':
main.c:78:19: warning: comparison between pointer and integer
   78 |         if(isEmpty==1)exit(1);
      |                   ^~
Language: C

#include <stdio.h>


typedef struct{
char name[10];
int time;
}queue;

queue Q[100000];

int head=0;
int tail=0;


void enqueue(queue ,int);
queue dequeue(int);

int main(){
	int n,i,q;
	int count=0;
	scanf("%d%d",&n,&q);
	queue Que;

	for(i=0;i<n;i++){
		scanf("%s",Que.name);
		scanf("%d",&Que.time);
		enqueque(Que,n);
	}



	while(1){
		if(head==tail)break;
	
		if(Q[head].time<=q){
			Que=dequeue(n);
			count+=Que.time;
			printf("%s %d\n",Que.name,count);
		}
		else{
			Que=dequeue(n);
			Que.time-=q;
			count+=q;
			enqueue(Que,n);
		}
	}	

	return 0;
}

void enqueue(queue x,int n){
	Q[tail]=x;
	if(tail+1==n)tail=0;
	else tail++;
}



queue dequeue(int n){
	queue x;
	x=Q[head];
	if(head+1==n)head=0;
	else head++;
	return x;
}

Compiler output:
main.c: In function 'main':
main.c:27:17: error: implicit declaration of function 'enqueque'; did you mean 'enqueue'? [-Wimplicit-function-declaration]
   27 |                 enqueque(Que,n);
      |                 ^~~~~~~~
      |                 enqueue
Language: C

#include<stdio.h>
#include<string.h>
#define LEN 100005
  
typedef struct pp{
  char name[100];
  int t;
}P;
  
P Q[LEN+1];
int head, tail, n;
  
void enqueue(P x){
  Q[tail]=x;
  if(tail+1 == LEN+1)tail=0;
  else  tail++;
}
  
P dequeue(){
  P x;
  x=Q[head];
  if(head+1 == LEN+1)head=0;
  else head++;
  return x;
}
  
int isEmpty(){
  if(head == tail) 
     return 1;
  else
     return 0;
}
  
int main(){
  int elaps = 0;
  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(1){
    if(head==tail)break;

    u = dequeue();
    c = u.t - q;
      
    if(u.t > q){
      elaps += q;
      u.t -= q;
      enqueue(u);
    }
      
    else {
      elaps += u.t;
      printf("%s %d\n",u.name,elaps);
    }
  
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:52:5: error: 'c' undeclared (first use in this function)
   52 |     c = u.t - q;
      |     ^
main.c:52:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#define max 300000

typedef struct process{
  char name[256];
  int time;
} p;

int  head = 0, tail = 0, n;
p Q[max];

void enqueue(p);
p dequeue(void);

int main(){
  int i, q, temp, passage = 0;
  p dq;

  scanf("%d%d", &n, &q);

  head = 1; 
  tail = n + 1;

  for(i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].time);
  }

  while(tail != head)){
    p dq = dequeue();
    if(q > dq.time)   temp = dq.time;
    else               temp = q;
    passage += temp;
    dq.time -= temp;
    if(dq.time > 0)   enqueue(dq);
    else                     printf("%s %d\n", dq.name, passage);
  }
      
  return 0;
}

void enqueue(p x){
  Q[tail] = x;
  if(tail + 1 == max)    tail = 0;
  else                           tail++;
}

p dequeue(void){
  p x = Q[head];
  if(head + 1 == max)    head = 0;
  else                              head++;
  return x;
}

Compiler output:
main.c: In function 'main':
main.c:29:22: error: expected statement before ')' token
   29 |   while(tail != head)){
      |                      ^
Language: C

#include<stdio.h>
#include<string.h>
#define MAX 10000

typedef struct pp
{
  char name[10];
  int t;
}P;

P Q[MAX + 1];
int head, tail, n;

void enqueue(P x)
{
  Q[tail] = x;
  tail = (tail + 1)%MAX;
}

P dequeue()
{

  P x = Q[head];#include<stdlib.h>
  head = (head + 1)%MAX;
  return x;
} 

int min (int a, int b)
{
  if(a < b) return a;
  else if(b < a) return b;
}


int main()
{
  int  elaps = 0, c;
  int i, q;
  P u;

  scanf("%d %d", &n, &q);

  head = 1;
  tail = n + 1;

  for ( i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }

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

  return 0;
}

Compiler output:
main.c: In function 'dequeue':
main.c:23:17: error: stray '#' in program
   23 |   P x = Q[head];#include<stdlib.h>
      |                 ^
main.c:23:18: error: 'include' undeclared (first use in this function)
   23 |   P x = Q[head];#include<stdlib.h>
      |                  ^~~~~~~
main.c:23:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:23:26: error: 'stdlib' undeclared (first use in this function); did you mean 'stdin'?
   23 |   P x = Q[head];#include<stdlib.h>
      |                          ^~~~~~
      |                          stdin
Language: C

#include <string>
#include <stdio.h>
#include <math.h>
#define N 1000
void enqueue(int);
int dequeue(void);
int isEmpty(void);
int isFull(void);
void initialize(void);
int S[N], head = 0, tail = 0, n, q;
int main(void)
{
	char str[N][11];
	int x, a, cou = 0, time = 0, i, j;
	scanf("%d %d", &n, &q);
	for (i = 0; i < n; i++) {
		scanf("%s %d", &str[i], &x);
		enqueue(x);
	}
	a = n;
	for (i = 0; i < a; i++) {
		x = dequeue();
		if (x > q) {
			enqueue(x - q); time += q;
			for (j = 0; str[i][j - 1] != '\0' && str[i - cou][j - 1] != '\0'; j++) {
				str[i - cou][j] = str[i][j];
			}
		}
		else {
			time += x;
			if (i < a) {
				cou++;
				cout << str[i] << time << endl;
			}
		}
		if (i >= a - 1) {
			i = -1;
			a = a - cou;
			cou = 0;
		}
	}
}
void enqueue(int X)
{
	if (!(isFull())) {
		S[tail] = X;
		if (tail == N - 1) { tail = 0; }
		else tail++;
	}
}
int dequeue(void)
{
	if (!(isEmpty())) {
		if (head == N - 1) { head = 0; return (S[N - 1]); }
		else { head++; return (S[head - 1]); }
	}
}
int isEmpty(void)
{
	if (head == tail) return 1;
	else return 0;
}
int isFull(void)
{
	if (head == (tail + 1) % N) return 1;
	else return 0;

}
void initialize(void)
{
	head = 0; tail = 0;
}

Compiler output:
main.c:1:10: fatal error: string: No such file or directory
    1 | #include <string>
      |          ^~~~~~~~
compilation terminated.
Language: C

#include <string>
#include <stdio.h>
#include <math.h>
#define N 1000
void enqueue(int);
int dequeue(void);
int isEmpty(void);
int isFull(void);
void initialize(void);
int S[N], head = 0, tail = 0, n, q;
int main(void)
{
	char str[N][11];
	int x, a, cou = 0, time = 0, i, j;
	scanf("%d %d", &n, &q);
	for (i = 0; i < n; i++) {
		scanf("%s %d", str, &x);
		enqueue(x);
	}
	a = n;
	for (i = 0; i < a; i++) {
		x = dequeue();
		if (x > q) {
			enqueue(x - q); time += q;
			for (j = 0; str[i][j - 1] != '\0' && str[i - cou][j - 1] != '\0'; j++) {
				str[i - cou][j] = str[i][j];
			}
		}
		else {
			time += x;
			if (i < a) {
				cou++;
				cout << str[i] << time << endl;
			}
		}
		if (i >= a - 1) {
			i = -1;
			a = a - cou;
			cou = 0;
		}
	}
}
void enqueue(int X)
{
	if (!(isFull())) {
		S[tail] = X;
		if (tail == N - 1) { tail = 0; }
		else tail++;
	}
}
int dequeue(void)
{
	if (!(isEmpty())) {
		if (head == N - 1) { head = 0; return (S[N - 1]); }
		else { head++; return (S[head - 1]); }
	}
}
int isEmpty(void)
{
	if (head == tail) return 1;
	else return 0;
}
int isFull(void)
{
	if (head == (tail + 1) % N) return 1;
	else return 0;

}
void initialize(void)
{
	head = 0; tail = 0;
}

Compiler output:
main.c:1:10: fatal error: string: No such file or directory
    1 | #include <string>
      |          ^~~~~~~~
compilation terminated.