criyle/codenet-compile-errors huggingface dataset:
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 equeue(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;
}

if()

Compiler output:
main.c: In function 'dequeue':
main.c:19:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
   19 | P x-Q[head];
      |    ^
main.c:19:4: error: wrong type argument to unary minus
main.c:21:8: error: 'x' undeclared (first use in this function)
   21 | return x;
      |        ^
main.c:21:8: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:44:10: error: implicit declaration of function 'enqueue'; did you mean 'equeue'? [-Wimplicit-function-declaration]
   44 | if(u.t>0)enqueue(u);
      |          ^~~~~~~
      |          equeue
main.c: At top level:
main.c:53:1: error: expected identifier or '(' before 'if'
   53 | if()
      | ^~
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 equeue(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: In function 'main':
main.c:44:10: error: implicit declaration of function 'enqueue'; did you mean 'equeue'? [-Wimplicit-function-declaration]
   44 | if(u.t>0)enqueue(u);
      |          ^~~~~~~
      |          equeue
Language: C

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

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

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

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

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

int min(int a,int b)
{
  return a<b?a:b;
}

int main()
{
  int elaps=0,c;
  int i,q;
  data 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 'main':
main.c:35:3: error: unknown type name 'data'
   35 |   data u;
      |   ^~~~
main.c:48:9: error: incompatible types when assigning to type 'int' from type 'P' {aka 'struct pp'}
   48 |       u=dequeue();
      |         ^~~~~~~
main.c:49:16: error: request for member 't' in something not a structure or union
   49 |       c=min(q,u.t);
      |                ^
main.c:50:8: error: request for member 't' in something not a structure or union
   50 |       u.t-=c;
      |        ^
main.c:52:11: error: request for member 't' in something not a structure or union
   52 |       if(u.t>0) enqueue(u);
      |           ^
main.c:52:25: error: incompatible type for argument 1 of 'enqueue'
   52 |       if(u.t>0) enqueue(u);
      |                         ^
      |                         |
      |                         int
main.c:13:16: note: expected 'P' {aka 'struct pp'} but argument is of type 'int'
   13 | void enqueue(P x)
      |              ~~^
main.c:55:29: error: request for member 'name' in something not a structure or union
   55 |           printf("%s %d\n",u.name,elaps);
      |                             ^
Language: C


#include <stdio.h>
#include <string.h>
#define TRUE 1
#define FALSE -1
#define MAX 100005
??
typedef struct pp {
????char name[10];
????int time;
} P;
??
P Q[MAX];
int head, tail, n;
??
void enqueue(P x);
P dequeue();
int isEmpty();
int isFull();
int min(int a, int 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].time);
????}
????head = 1;
????tail = n+1;
??
????while( head != tail){
????????u = dequeue();
????????c = min(q, u.time);
????????u.time -= c;
????????elaps += c;
????????if( u.time > 0 ){
????????????enqueue(u);
????????} else {
????????????printf("%s %d\n", u.name, elaps);
????????}
????}
return 0;
}
??
int isEmpty(){
????if(head == tail){
????????return TRUE;
????} else {
????????return FALSE;
????}
}
??
int isFull(){
????if(head == (tail + 1) % MAX){
????????return TRUE;
????} else {
????????return FALSE;
????}
}
??
void enqueue(P x){
??????if(isFull() == TRUE){
??????????fprintf(stderr, "overflow\n");
??????}
????????Q[tail] = x;
????????tail = (tail + 1) % MAX;
??}
??
P dequeue(){
????P x;
????if(isEmpty() == TRUE){
????????fprintf(stderr, "underflow\n");
????}
????x = Q[head];
????head = (head + 1) % MAX;
????return x;
}
??
int min(a,b){
????return a<b ? a:b ;
}

Compiler output:
main.c:7:1: error: expected identifier or '(' before '?' token
    7 | ??
      | ^
main.c:11:3: warning: data definition has no type or storage class
   11 | } P;
      |   ^
main.c:11:3: error: type defaults to 'int' in declaration of 'P' [-Wimplicit-int]
main.c:12:1: error: expected identifier or '(' before '?' token
   12 | ??
      | ^
main.c:15:1: error: expected identifier or '(' before '?' token
   15 | ??
      | ^
main.c:17:1: error: unknown type name 'P'
   17 | P dequeue();
      | ^
main.c:21:1: error: expected identifier or '(' before '?' token
   21 | ??
      | ^
main.c:49:1: error: expected identifier or '(' before '?' token
   49 | ??
      | ^
main.c:57:1: error: expected identifier or '(' before '?' token
   57 | ??
      | ^
main.c:65:1: error: expected identifier or '(' before '?' token
   65 | ??
      | ^
main.c:73:1: error: expected identifier or '(' before '?' token
   73 | ??
      | ^
main.c:83:1: error: expected identifier or '(' before '?' token
   83 | ??
      | ^
Language: C

#include <stdio.h>
#include <string.h>
#define TRUE 1
#define FALSE -1
#define MAX 100005
??
typedef struct pp {
????char name[10];
????int time;
} P;
??
P Q[MAX];
int head, tail, n;
??
void enqueue(P x);
P dequeue();
int isEmpty();
int isFull();
int min(int a, int 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].time);
????}
????head = 1;
????tail = n+1;
??
????while( head != tail){
????????u = dequeue();
????????c = min(q, u.time);
????????u.time -= c;
????????elaps += c;
????????if( u.time > 0 ){
????????????enqueue(u);
????????} else {
????????????printf("%s %d\n", u.name, elaps);
????????}
????}
return 0;
}
??
int isEmpty(){
????if(head == tail){
????????return TRUE;
????} else {
????????return FALSE;
????}
}
??
int isFull(){
????if(head == (tail + 1) % MAX){
????????return TRUE;
????} else {
????????return FALSE;
????}
}
??
void enqueue(P x){
??????if(isFull() == TRUE){
??????????fprintf(stderr, "overflow\n");
??????}
????????Q[tail] = x;
????????tail = (tail + 1) % MAX;
??}
??
P dequeue(){
????P x;
????if(isEmpty() == TRUE){
????????fprintf(stderr, "underflow\n");
????}
????x = Q[head];
????head = (head + 1) % MAX;
????return x;
}
??
int min(a,b){
????return a<b ? a:b ;
}

Compiler output:
main.c:6:1: error: expected identifier or '(' before '?' token
    6 | ??
      | ^
main.c:10:3: warning: data definition has no type or storage class
   10 | } P;
      |   ^
main.c:10:3: error: type defaults to 'int' in declaration of 'P' [-Wimplicit-int]
main.c:11:1: error: expected identifier or '(' before '?' token
   11 | ??
      | ^
main.c:14:1: error: expected identifier or '(' before '?' token
   14 | ??
      | ^
main.c:16:1: error: unknown type name 'P'
   16 | P dequeue();
      | ^
main.c:20:1: error: expected identifier or '(' before '?' token
   20 | ??
      | ^
main.c:48:1: error: expected identifier or '(' before '?' token
   48 | ??
      | ^
main.c:56:1: error: expected identifier or '(' before '?' token
   56 | ??
      | ^
main.c:64:1: error: expected identifier or '(' before '?' token
   64 | ??
      | ^
main.c:72:1: error: expected identifier or '(' before '?' token
   72 | ??
      | ^
main.c:82:1: error: expected identifier or '(' before '?' token
   82 | ??
      | ^
Language: C

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

typedef struct pp{
  char name[100];
  int t;
}A;
A Q[100000];
int head=0, tail, n;
void enqueue(P x){
  strcpy(Q[tail].name,x.name);
  Q[tail].t = x.t;
  tail++;
  if(tail == 100000){
    tail = 0;
  }
}
int main(){
  int elaps = 0;
  int i, q;
  scanf("%d %d", &n, &q);
  for ( i = 0; i < n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }
  tail = n;
  while(tail!=head){
    if(Q[head].t > q){
      elaps += q;
      Q[head].t -= q;
      enqueue(Q[head]);
    }
    else{
      elaps+=Q[head].t;
      printf("%s %d\n",Q[head].name,elaps);
    }
    head++;
    if(head == 100000){
      head = 0;
    }
  }
  return 0;
}

Compiler output:
main.c:10:14: error: unknown type name 'P'
   10 | void enqueue(P x){
      |              ^
main.c: In function 'main':
main.c:31:7: error: implicit declaration of function 'enqueue' [-Wimplicit-function-declaration]
   31 |       enqueue(Q[head]);
      |       ^~~~~~~
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 == n){
    tail = 0;
  } else {
    tail++;
  }
}
 
P dequeue(){
  P x;
  x.name = Q[head].name;
  x.t = Q[head].t;
  if(head+1 == n){
    head = 0;
  } else {
    head++;
    return x;
  }
 
}
 
int main(){
  int elaps = 0, c, min;
  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 = dequence();
    if(q < u.t) min = q;
    else if(u.t < q) min = u.t;
    u.t -= min;
    elaps += min;
    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:24:10: error: assignment to expression with array type
   24 |   x.name = Q[head].name;
      |          ^
main.c: In function 'main':
main.c:50:9: error: implicit declaration of function 'dequence'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   50 |     u = dequence();
      |         ^~~~~~~~
      |         dequeue
main.c:50:9: error: incompatible types when assigning to type 'P' {aka 'struct pp'} from type 'int'
Language: C

#include<string.h>
#include<stdio.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;
  x = Q[head];
  head=(head+1)%LEN;
   return x;


}
int min(int a,int 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 'main':
main.c:28:15: error: 'c' undeclared (first use in this function)
   28 |   int elaps=0;c;
      |               ^
main.c:28:15: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'min':
main.c:48:1: error: expected declaration or statement at end of input
   48 | }
      | ^
Language: C

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

typedef struct{
  char name[10];
  int time;
    scanf("%d",&p[i].time);
  }
  while(head!=end){
    if(p[head].time<=q){
      count+=p[head].time;
      p[head].time=0;
      printf("%s %d\n",p[head].name,count);
    }
    else{
      p[head].time-=q;
      count+=q;
    }
    head++;
    if(head==n+1)
      head=0;
    if(head==0)
      ead=n;
    else
      ead=head-1;
    if(p[ead].time!=0){
      p[end]=p[ead];
      end++;
    }
    if(end==n+1)
      end=0;
  }  
  return 0;
}

Compiler output:
main.c:7:5: error: expected specifier-qualifier-list before 'scanf'
    7 |     scanf("%d",&p[i].time);
      |     ^~~~~
main.c:9:3: error: expected identifier or '(' before 'while'
    9 |   while(head!=end){
      |   ^~~~~
main.c:33:3: error: expected identifier or '(' before 'return'
   33 |   return 0;
      |   ^~~~~~
main.c:34:1: error: expected identifier or '(' before '}' token
   34 | }
      | ^
Language: C

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

#define MAX 100000
#define TRUE 1
#define FALSE 0

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

int isEmpty(void);
int isFull(void);
void enqueue(Que );
Que dequeue(void);

Que Q[MAX+1];
int head;
int tail;

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

  while(n!=0){
    que=dequeue();
    if(q<que.time){
          que.time -= q;
	  sum += q;
	  enqueue(que);
    }
    else{
      sum += que.time;
      printf("%s %d\n",que.name,sum);
      n--;
    }

  } 

  return 0;
}

int isEmpty(){
  if(head==tail) return TRUE;
  else return FALSE;
}

int isFull(){
  if(head==(tail+1)%MAX) return TRUE;
  else return FALSE;
}

void enqueue(Que x){
  if(isFull()==1){
    fprintf(stderr,"ERROR!");
    exit(1);
  }
  Q[tail]=x;
  if(tail==MAX) tail=0;
  else tail++;
}

Que dequeue(){
  if(isEmpty()==1){
    fprintf(stderr,"ERROR!");
    exit(1);
  }
  if(head==MAX) head==0;
  return x= Q[head++];
}

Compiler output:
main.c: In function 'dequeue':
main.c:77:10: error: 'x' undeclared (first use in this function)
   77 |   return x= Q[head++];
      |          ^
main.c:77:10: 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
#define TRUE 1
#define FALSE 0

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

int isEmpty(void);
int isFull(void);
void enqueue(Que );
Que dequeue(void);

Que Q[MAX+1];
int head;
int tail;

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

  while(n!=0){
    que=dequeue();
    if(q<que.time){
          que.time -= q;
	  sum += q;
	  enqueue(que);
    }
    else{
      sum += que.time;
      printf("%s %d\n",que.name,sum);
      n--;
    }

  } 

  return 0;
}

int isEmpty(){
  if(head==tail) return TRUE;
  else return FALSE;
}

int isFull(){
  if(head==(tail+1)%MAX) return TRUE;
  else return FALSE;
}

void enqueue(Que x){
  if(isFull()==1){
    fprintf(stderr,"ERROR!");
    exit(1);
  }
  if(tail==MAX) tail=0;
  Q[tail]=x;
  else tail++;
}

Que dequeue(){
  if(isEmpty()==1){
    fprintf(stderr,"ERROR!");
    exit(1);
  }
  if(head==MAX) head==0;
  return Q[head++];
}

Compiler output:
main.c: In function 'enqueue':
main.c:68:3: error: 'else' without a previous 'if'
   68 |   else tail++;
      |   ^~~~
Language: C

#include<stdio.h>
#include<string.h>
#define LEN 100005
#define MAX 100000
void initialize(void);
int isEmpty(void);
int isFull(void);
void enqueue(int);
int dequeue(void);

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

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

void enqueue(P x){
  if(isFull()){
    printf("error(overflow)");
      }
  Q[tail] = x;
  if(tail + 1 == MAX) tail = 0;
  else tail++;
}

P dequeue(){
  P a;
  if(isEmpty()){
    printf("error(underflow)");
      }
  a = Q[head];
  if(head + 1 == MAX) head = 0;
  else head++;
  return a;
}
int isEmpty(void){
  if(head==tail)
  return 1;
  else return 0;
}
inr isFull(void){
  if((head==tail+1)% MAX)
    return 1;
  else return 0;
}
  
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(n != 0){
    u = Q[head];
    u.t = Q[head].t - q;
    if(u.t > 0){
      elaps = elaps + q;
      enqueue(u);
      Q[head]=dequeue();
    } else {
      elaps = elaps + Q[head].t;
      printf("%s %d\n",u.name,elaps);
      Q[head] = dequeue();
      n--;
    }
  }
  return 0;
}

Compiler output:
main.c:19:6: error: conflicting types for 'enqueue'; have 'void(P)' {aka 'void(struct pp)'}
   19 | void enqueue(P x){
      |      ^~~~~~~
main.c:8:6: note: previous declaration of 'enqueue' with type 'void(int)'
    8 | void enqueue(int);
      |      ^~~~~~~
main.c:28:3: error: conflicting types for 'dequeue'; have 'P()' {aka 'struct pp()'}
   28 | P dequeue(){
      |   ^~~~~~~
main.c:9:5: note: previous declaration of 'dequeue' with type 'int(void)'
    9 | int dequeue(void);
      |     ^~~~~~~
main.c:43:1: error: unknown type name 'inr'; did you mean 'int'?
   43 | inr isFull(void){
      | ^~~
      | int
Language: C

#include<stdio.h>
#include<string.h>
#define LENG 100005
#define MAX 100000
typedef struct aa{
  char name[100];
  int t;
}A;

A Q[LENG+1];
int head, tail, n;
void enqueue(A x){
  if(isFull()){
    printf("error(overflow)");
  }
  Q[tail] = x;
  if(tail+1 == MAX)tail = 0;
  else tail++;
}

A dequeue(){
  A res;
  if(isEmpty()){
    printf("error(underflow)");
  }
  res = Q[head];
  if(head+1==MAX)head = 0;
  else head++;
  return res;
}
int isEmpty(void){
  if(head == tail)
    return 1;
  else return 0;
}
int isFull(void){
  if((head == tail+1)%MAX)
    return 1;
  else return 0;
}
int main(){
  int alg=0,c;
  int i,q;
  A rew;
  scanf("%d%d",&n,&q);
  for(i=1;i<=n;i++){
    scanf("%s",Q[i].name);
    scand("%d",&Q[i].t);
  }
  head=1;
  tail = n+1;
  while(n!=0){
    rew = Q[head];
    rew.t = Q[head].t-q;
    if(rew.t>0){
      alg = alg+q;
      enqueue(rew);
      Q[head] = dequeue();
    }else{
      alg = alg+Q[head].t;
      printf("%s %d\n",rew.name,alg);
      Q[head] = dequeue();
      n--;
    }
  }return 0;
}

Compiler output:
main.c: In function 'enqueue':
main.c:13:6: error: implicit declaration of function 'isFull' [-Wimplicit-function-declaration]
   13 |   if(isFull()){
      |      ^~~~~~
main.c: In function 'dequeue':
main.c:23:6: error: implicit declaration of function 'isEmpty' [-Wimplicit-function-declaration]
   23 |   if(isEmpty()){
      |      ^~~~~~~
main.c: In function 'main':
main.c:48:5: error: implicit declaration of function 'scand'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   48 |     scand("%d",&Q[i].t);
      |     ^~~~~
      |     scanf
Language: C

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

type struct pp {
	char name[100]; //Is it OK if name isn't array?
	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, &q);

	for ( int i = 1; i <= n; i++) {
		scanf("%s", Q[i].name); //Q.name??????????????????? name[100]??????????????????
		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", u.name, elaps);
	}
}

return 0;
}

Compiler output:
main.c:5:5: error: expected ';' before 'struct'
    5 | type struct pp {
      |     ^~~~~~~
      |     ;
main.c:10:1: error: unknown type name 'P'
   10 | P Q[LEN];
      | ^
main.c:13:14: error: expected declaration specifiers or '...' before 'P'
   13 | void enqueue(P x) {
      |              ^
main.c:18:1: error: unknown type name 'P'
   18 | P dequeue() {
      | ^
main.c: In function 'dequeue':
main.c:19:10: error: expected ';' before 'x'
   19 |         P x = Q[head];
      |          ^~
      |          ;
main.c:21:16: error: 'x' undeclared (first use in this function)
   21 |         return x;
      |                ^
main.c:21:16: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:29:10: error: expected ';' before 'u'
   29 |         P u;
      |          ^~
      |          ;
main.c:33:33: error: request for member 'name' in something not a structure or union
   33 |                 scanf("%s", Q[i].name); //Q.name??????????????????? name[100]??????????????????
      |                                 ^
main.c:34:34: error: request for member 't' in something not a structure or union
   34 |                 scanf("%d", &Q[i].t)
      |                                  ^
main.c:34:37: error: expected ';' before '}' token
   34 |                 scanf("%d", &Q[i].t)
      |                                     ^
      |                                     ;
   35 |                 }
      |                 ~                    
main.c:39:9: error: 'u' undeclared (first use in this function)
   39 |         u = dequeue();
      |         ^
main.c:43:23: error: implicit declaration of function 'enqueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   43 |         if( u.t > 0 ) enqueue(u);
      |                       ^~~~~~~
      |                       dequeue
Language: C

#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }
struct Job {
	char name[20];
	int time;
	Job() {}
	Job(char *c, int t) {
		strcpy(name, c);
		time = t;
	}
};
struct Queue {
	int b, e, len;;
	Job j[100000];
	Queue() {
		len = 100000;
		b = 0;
		e = 0;
	}
	Job front() {
		Job ret = j[b];
		b = (b + 1) % len;
		return ret;
	}
	void push(Job in) {
		j[e] = in;
		e = (e + 1) % len;
	}
	bool empty() {
		return b == e;
	}
};
signed main() {
	int n, q; cin >> n >> q;
	int now = 0;
	static Queue m;
	rep(i, 0, n) {
		char c[20]; int t;
		scanf("%s %d", c, &t);
		m.push(Job(c, t));
	}
	while (!m.empty()) {
		Job tmp = m.front();
		//printf("debug : %s %d\n", tmp.name, tmp.time);
		int x = min(q, tmp.time);
		now += x;
		tmp.time -= x;
		if (tmp.time == 0) {
			printf("%s %d\n", tmp.name, now);
		}
		else {
			m.push(tmp);
		}
	}
	return 0;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include "bits/stdc++.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
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, &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.y -= 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:17:9: error: unknown type name 'p'
   17 |         p x = Q[head];
      |         ^
main.c:17:15: error: incompatible types when initializing type 'int' using type 'P' {aka 'struct pp'}
   17 |         p x = Q[head];
      |               ^
main.c:19:16: error: incompatible types when returning type 'int' but 'P' {aka 'struct pp'} was expected
   19 |         return x;
      |                ^
main.c: In function 'main':
main.c:39:18: error: 'P' {aka 'struct pp'} has no member named 'y'
   39 |                 u.y -= c;
      |                  ^
Language: C

#include<stdio.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 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 'main':
main.c:36:7: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   36 |     c=min(q,u.t);
      |       ^~~
      |       main
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 0;
}

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: In function 'dequeue':
main.c:21:16: error: incompatible types when returning type 'int' but 'P' {aka 'struct pp'} was expected
   21 |         return 0;
      |                ^
Language: C

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

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

//?????°??£?¨?
katamei Q[LEN + 1];
int head=1, tail, n;

void enqueue(katamei x){
  Q[tail] = x;
  if(tail >= LEN){
    tail=0;
  }
  else{
    tail++;
  }
}

katamei dequeue(){
  katamei y;
  y = Q[head];
  if(head >= LEN){
    head = 0;
  }
  else{
    head++;
  }
  return y;
}


int main(){
  int time = 0;
  int i, q;
  scanf("%d %d", &n, &q);
  tail=n+1;

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:51:7: error: 'sum' undeclared (first use in this function)
   51 |       sum += q;
      |       ^~~
main.c:51:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

typedef struct {
  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)tail = 0;
else tail++;
}

P dequeue(){
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);
  }


  while(1){
    if(Q[head].t <= q){
      elaps += Q[head].t;
      printf("%s %d\n", Q[head].name, elaps);
                  dequeue(Q[head]);
                  cnt++;
                  if(cnt == n)break;
              }
     else {
                  Q[head].t -=q;
                  elaps += q;
                  enqueue(dequeue(Q[head]));
          }
            }
  return 0;
}

Compiler output:
main.c: In function 'dequeue':
main.c:20:1: error: 'x' undeclared (first use in this function)
   20 | x = Q[head];
      | ^
main.c:20:1: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:44:19: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
   44 |                   cnt++;
      |                   ^~~
      |                   int
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)tail = 0;
else tail++;
}

P dequeue(){
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);
  }


  while(1){
    if(Q[head].t <= q){
      elaps += Q[head].t;
      printf("%s %d\n", Q[head].name, elaps);
                  dequeue(Q[head]);
                  cnt++;
                  if(cnt == n)break;
              }
     else {
                  Q[head].t -=q;
                  elaps += q;
                  enqueue(dequeue(Q[head]));
          }
            }
  return 0;
}

Compiler output:
main.c: In function 'dequeue':
main.c:20:1: error: 'x' undeclared (first use in this function)
   20 | x = Q[head];
      | ^
main.c:20:1: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:44:19: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
   44 |                   cnt++;
      |                   ^~~
      |                   int
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)tail = 0;
else tail++;
}

P dequeue(){
P x;
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);
  }


  while(1){
    if(Q[head].t <= q){
      elaps += Q[head].t;
      printf("%s %d\n", Q[head].name, elaps);
                  dequeue(Q[head]);
                  cnt++;
                  if(cnt == n)break;
              }
     else {
                  Q[head].t -=q;
                  elaps += q;
                  enqueue(dequeue(Q[head]));
          }
            }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:45:19: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
   45 |                   cnt++;
      |                   ^~~
      |                   int
main.c:45:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<iostream>
#include<queue>
using namespace std;

int main(){
    int n,q;
    int a,time=0;
    string s;
    queue<int> Q;
    queue<string> name;

    cin >> n >> q;
    for(int i=0;i<n;i++){
        cin >> s >> a;
        Q.push(a);
        name.push(s);

    }

    while(Q.empty()==false){
        a=Q.front();
        s=name.front();
        if(a>=q){
            time+=q;
            a-=q;
            Q.pop();
            name.pop();
            Q.push(a);
            name.push(s);
        }else{
            time+=a;
            a=0;
            cout << name.front() << " " << time << endl;
            name.pop();
            Q.pop();
        }
    }

    return 0;
}

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

#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;

#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, &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:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<string.h>
#define LEN 1000000
typedef struct pp{
  char name[100];
  int t;
}P;
P Q[LEN+1];
int main(){
  int n,i,q,s=0,l,c=0;
  scanf("%d %d",&n,&q);
  for (i=1;i<=n;i++){
    scanf("%s",Q[i].name);
    scanf("%d",&Q[i].t);
  }
  i=1;
  l=n;
  while(1){
    if(Q[i].t>q){
      s+=q;
      strcpy(Q[l+1].name, Q[i].name);
      Q[l+1].t=Q[i].t-q;
      l++;
    } else {
      sum += Q[i].t;
      printf("%s %d\n",Q[i].name,s);
      c++;
    }
    i++;
    if(c==n) break;
  }   
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:7: error: 'sum' undeclared (first use in this function)
   25 |       sum += Q[i].t;
      |       ^~~
main.c:25:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

typedef struct pp{
	charname[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;}//min

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=deque();
		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:3:1: error: unknown type name 'Define'
    3 | Define LEN 100005
      | ^~~~~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant
    3 | Define LEN 100005
      |            ^~~~~~
main.c:8:2: warning: data definition has no type or storage class
    8 | }P;
      |  ^
main.c:8:2: error: type defaults to 'int' in declaration of 'P' [-Wimplicit-int]
main.c:10:1: error: unknown type name 'P'
   10 | P Q[LEN];
      | ^
main.c:10:5: error: 'LEN' undeclared here (not in a function)
   10 | P Q[LEN];
      |     ^~~
main.c:13:14: error: expected declaration specifiers or '...' before 'P'
   13 | void enqueue(P x){
      |              ^
main.c:18:1: error: unknown type name 'P'
   18 | P dequeue(){
      | ^
main.c: In function 'dequeue':
main.c:19:10: error: expected ';' before 'x'
   19 |         P x=Q[head];
      |          ^~
      |          ;
main.c:21:16: error: 'x' undeclared (first use in this function)
   21 |         return x;
      |                ^
main.c:21:16: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:29:10: error: expected ';' before 'u'
   29 |         P u;
      |          ^~
      |          ;
main.c:41:17: error: 'u' undeclared (first use in this function)
   41 |                 u=deque();
      |                 ^
main.c:41:19: error: implicit declaration of function 'deque'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   41 |                 u=deque();
      |                   ^~~~~
      |                   dequeue
main.c:45:26: error: implicit declaration of function 'enqueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   45 |                 if(u.t>0)enqueue(u);
      |                          ^~~~~~~
      |                          dequeue
main.c: At top level:
main.c:50:1: error: expected identifier or '(' before 'return'
   50 | return 0;
      | ^~~~~~
main.c:51:1: error: expected identifier or '(' before '}' token
   51 | }
      | ^
Language: C

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

/* プロセスを表す構造体 */
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, &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:14:14: error: unknown type name 'P'
   14 | void enqueue(P x){
      |              ^
main.c: In function 'dequeue':
main.c:20:9: error: unknown type name 'P'
   20 |         P x=Q[head];
      |         ^
main.c:20:13: error: incompatible types when initializing type 'int' using type 'p' {aka 'struct pp'}
   20 |         P x=Q[head];
      |             ^
main.c:22:16: error: incompatible types when returning type 'int' but 'p' {aka 'struct pp'} was expected
   22 |         return x;
      |                ^
main.c: In function 'main':
main.c:30:9: error: unknown type name 'P'
   30 |         P u;
      |         ^
main.c:41:19: error: expected ')' before '!' token
   41 |         while(head! = tail){
      |              ~    ^
      |                   )
main.c:42:19: error: incompatible types when assigning to type 'int' from type 'p' {aka 'struct pp'}
   42 |                 u=dequeue();
      |                   ^~~~~~~
main.c:43:27: error: request for member 't' in something not a structure or union
   43 |                 c=min(q, u.t);
      |                           ^
main.c:44:18: error: request for member 't' in something not a structure or union
   44 |                 u.t-=c;
      |                  ^
main.c:46:21: error: request for member 't' in something not a structure or union
   46 |                 if(u.t>0) enqueue(u);
      |                     ^
main.c:46:27: error: implicit declaration of function 'enqueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   46 |                 if(u.t>0) enqueue(u);
      |                           ^~~~~~~
      |                           dequeue
main.c:48:43: error: request for member 'name' in something not a structure or union
   48 |                         printf("%s %d\n",u.name, elaps);
      |                                           ^
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,&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 'enqueue':
main.c:14:9: error: 'Q' undeclared (first use in this function)
   14 |         Q[tail]=x;
      |         ^
main.c:14:9: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'dequeue':
main.c:19:13: error: 'Q' undeclared (first use in this function)
   19 |         P x=Q[head];
      |             ^
main.c: In function 'main':
main.c:34:28: error: 'Q' undeclared (first use in this function)
   34 |                 scanf("%s",Q[i].name);
      |                            ^
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,%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 'main':
main.c:30:26: error: expected expression before '%' token
   30 |         scanf("%d %d",&n,%q);
      |                          ^
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, &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:14:14: error: unknown type name 'P'
   14 | void enqueue(P x){
      |              ^
main.c: In function 'dequeue':
main.c:20:9: error: unknown type name 'P'
   20 |         P x=Q[head];
      |         ^
main.c:20:13: error: incompatible types when initializing type 'int' using type 'p' {aka 'struct pp'}
   20 |         P x=Q[head];
      |             ^
main.c:22:16: error: incompatible types when returning type 'int' but 'p' {aka 'struct pp'} was expected
   22 |         return x;
      |                ^
main.c: In function 'main':
main.c:30:9: error: unknown type name 'P'
   30 |         P u;
      |         ^
main.c:41:19: error: expected ')' before '!' token
   41 |         while(head! = tail){
      |              ~    ^
      |                   )
main.c:42:19: error: incompatible types when assigning to type 'int' from type 'p' {aka 'struct pp'}
   42 |                 u=dequeue();
      |                   ^~~~~~~
main.c:43:27: error: request for member 't' in something not a structure or union
   43 |                 c=min(q, u.t);
      |                           ^
main.c:44:18: error: request for member 't' in something not a structure or union
   44 |                 u.t-=c;
      |                  ^
main.c:46:21: error: request for member 't' in something not a structure or union
   46 |                 if(u.t>0) enqueue(u);
      |                     ^
main.c:46:27: error: implicit declaration of function 'enqueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   46 |                 if(u.t>0) enqueue(u);
      |                           ^~~~~~~
      |                           dequeue
main.c:48:43: error: request for member 'name' in something not a structure or union
   48 |                         printf("%s %d\n",u.name, elaps);
      |                                           ^
Language: C

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

typdef 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;
	itni, 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);
		}
	}
	
	retunr 0;
}

Compiler output:
main.c:5:7: error: expected ';' before 'struct'
    5 | typdef struct pp{
      |       ^~~~~~~
      |       ;
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:18:1: error: unknown type name 'P'
   18 | P dequeue(){P x = Q[head];
      | ^
main.c: In function 'dequeue':
main.c:18:13: error: unknown type name 'P'
   18 | P dequeue(){P x = Q[head];
      |             ^
main.c: In function 'main':
main.c:27:9: error: 'itni' undeclared (first use in this function)
   27 |         itni, q;
      |         ^~~~
main.c:27:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:27:15: error: 'q' undeclared (first use in this function)
   27 |         itni, q;
      |               ^
main.c:28:9: error: unknown type name 'P'
   28 |         P u;
      |         ^
main.c:31:13: error: 'i' undeclared (first use in this function)
   31 |         for(i = 1;i <= n;i++){
      |             ^
main.c:39:28: error: request for member 't' in something not a structure or union
   39 |                 c = min(q,u.t);
      |                            ^
main.c:40:18: error: request for member 't' in something not a structure or union
   40 |                 u.t -= c;
      |                  ^
main.c:42:21: error: request for member 't' in something not a structure or union
   42 |                 if(u.t > 0)enqueue(u);
      |                     ^
main.c:42:28: error: implicit declaration of function 'enqueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   42 |                 if(u.t > 0)enqueue(u);
      |                            ^~~~~~~
      |                            dequeue
main.c:44:43: error: request for member 'name' in something not a structure or union
   44 |                         printf("%s %d\n",u.name,elaps);
      |                                           ^
main.c:48:9: error: 'retunr' undeclared (first use in this function)
   48 |         retunr 0;
      |         ^~~~~~
main.c:48:15: error: expected ';' before numeric constant
   48 |         retunr 0;
      |               ^~
      |               ;
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, &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 'main':
main.c:41:19: error: expected ')' before '!' token
   41 |         while(head! = tail){
      |              ~    ^
      |                   )
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, &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 'main':
main.c:38:19: error: expected ')' before '!' token
   38 |         while(head! = tail){
      |              ~    ^
      |                   )