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;
int head=0, tail, n;
void enqueue(P x);

void dequeue();

P Q[LEN+1];
int main(){
  int elaps = 0, c=0;
  int i, q;
  
  scanf("%d %d", &n, &q);
  tail=n;
  for ( i = 0; i < n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
    c+=Q[i].t;
  }
  while(elaps - c !=0){
      if(   Q[head].t>q   ){
	Q[i].t-=q;
	elaps+=q;
	enaqueue(Q[head]);
      }
      else {
	elaps+=Q[i].t;
	printf("%s %d\n",Q[i].name,elaps);

      }
    }
  haed++;
}
  return 0;
}
void enqueue(P x){

  strcpy(Q[tail].name,x.name);
  Q[tail].t=x.t;
  if(tail++ == LEN+1)tail=0;
}

Compiler output:
main.c: In function 'main':
main.c:30:9: error: implicit declaration of function 'enaqueue'; did you mean 'enqueue'? [-Wimplicit-function-declaration]
   30 |         enaqueue(Q[head]);
      |         ^~~~~~~~
      |         enqueue
main.c:38:3: error: 'haed' undeclared (first use in this function); did you mean 'head'?
   38 |   haed++;
      |   ^~~~
      |   head
main.c:38:3: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:40:3: error: expected identifier or '(' before 'return'
   40 |   return 0;
      |   ^~~~~~
main.c:41:1: error: expected identifier or '(' before '}' token
   41 | }
      | ^
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;
  tail=tail+1;
  tail=tail%(LEN+1);
}


P dequeue(){
  int l;
  l=head;
  head=head+1;
  head=head%(LEN+1);
}


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

  head=1;
  tail=n+1;

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

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

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

Compiler output:
main.c: In function 'main':
main.c:43:3: error: implicit declaration of function 'whil' [-Wimplicit-function-declaration]
   43 |   whil(0){
      |   ^~~~
main.c:43:10: error: expected ';' before '{' token
   43 |   whil(0){
      |          ^
      |          ;
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;
  tail=tail+1;
  tail=tail%(LEN+1);
}


P dequeue(){
  int l;
  l=head;
  head=head+1;
  head=head%(LEN+1);
  return Q[l];
}


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

  head=1;
  tail=n+1;

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

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

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

Compiler output:
main.c: In function 'main':
main.c:44:3: error: implicit declaration of function 'whil' [-Wimplicit-function-declaration]
   44 |   whil(0){
      |   ^~~~
main.c:44:10: error: expected ';' before '{' token
   44 |   whil(0){
      |          ^
      |          ;
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;
  tail++;
}

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

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

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

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
char name[10];
int speed;
long time;
}  Process;

int main()
{
Process S[10000],Fin[10000];
double i;
int z,num=0,qua=0;
double s_top =0,s_tail=0;
double fnum=0,time_spend=0;

scanf("%d %d",&num,&qua);
//printf("%d %d\n",num,qua);
for(i=0;i<num;i++)
{
z=scanf("%s %d",S[i].name,&S[i].speed);
S[i].time =0;
//printf("%s %d\n",S[i].name,S[i].speed);
if(z==EOF) break;
}
s_tail = num;

for(i=0;i<1000000000000;i++)
{
if(qua >= S[i].speed)
{
	time_spend+= S[i].speed;
 Fin[fnum].speed = S[i].speed;
strcpy(Fin[fnum].name,S[i].name);
Fin[fnum].time= time_spend;
//printf("finish  %s %d\n",Fin[fnum].name,Fin[fnum].time);
fnum++;
}
else 
{
	time_spend+= qua;
 S[s_tail].speed = S[i].speed - qua;
strcpy(S[s_tail].name,S[i].name);
// printf("%s  %d\n",S[s_tail].name,S[s_tail].speed);
s_tail++;
}
if(fnum==num) break;
}
  
for(i=0;i<num;i++)
{
printf("%s %d\n",Fin[i].name,Fin[i].time);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:18: error: array subscript is not an integer
   22 | z=scanf("%s %d",S[i].name,&S[i].speed);
      |                  ^
main.c:22:29: error: array subscript is not an integer
   22 | z=scanf("%s %d",S[i].name,&S[i].speed);
      |                             ^
main.c:23:2: error: array subscript is not an integer
   23 | S[i].time =0;
      |  ^
main.c:31:12: error: array subscript is not an integer
   31 | if(qua >= S[i].speed)
      |            ^
main.c:33:23: error: array subscript is not an integer
   33 |         time_spend+= S[i].speed;
      |                       ^
main.c:34:5: error: array subscript is not an integer
   34 |  Fin[fnum].speed = S[i].speed;
      |     ^
main.c:34:21: error: array subscript is not an integer
   34 |  Fin[fnum].speed = S[i].speed;
      |                     ^
main.c:35:11: error: array subscript is not an integer
   35 | strcpy(Fin[fnum].name,S[i].name);
      |           ^
main.c:35:24: error: array subscript is not an integer
   35 | strcpy(Fin[fnum].name,S[i].name);
      |                        ^
main.c:36:4: error: array subscript is not an integer
   36 | Fin[fnum].time= time_spend;
      |    ^
main.c:43:3: error: array subscript is not an integer
   43 |  S[s_tail].speed = S[i].speed - qua;
      |   ^
main.c:43:21: error: array subscript is not an integer
   43 |  S[s_tail].speed = S[i].speed - qua;
      |                     ^
main.c:44:9: error: array subscript is not an integer
   44 | strcpy(S[s_tail].name,S[i].name);
      |         ^
main.c:44:24: error: array subscript is not an integer
   44 | strcpy(S[s_tail].name,S[i].name);
      |                        ^
main.c:53:21: error: array subscript is not an integer
   53 | printf("%s %d\n",Fin[i].name,Fin[i].time);
      |                     ^
main.c:53:33: error: array subscript is not an integer
   53 | printf("%s %d\n",Fin[i].name,Fin[i].time);
      |                                 ^
Language: C

#Include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
  char name[10];
  int speed;
  int time;
}  Process;
 
int main()
{
  Process S[1000000];
  int i;
  int z,num=0,qua=0;
  int s_top =0,s_tail=0;
  int fnum=0,time_spend=0;
 
  scanf("%d %d",&num,&qua);
  //printf("%d %d\n",num,qua);
  for(i=0;i<num;i++)
    {
      z=scanf("%s %d",S[i].name,&S[i].speed);
      S[i].time =0;
      //printf("%s %d\n",S[i].name,S[i].speed);
      if(z==EOF) break;
    }
  s_tail = num;
 
  for(i=0;i<10000000;i++)
    {
      if(strcmp(S[s_tail].name,S[i].name)==0) s_top=s_top;
      if(qua >= S[i].speed)
	{
	  time_spend+= S[i].speed;
	  S[tail].speed = S[i].speed;
	  strcpy(S[s_tail].name,S[i].name);
	  S[tail].time= time_spend;
	  printf("%s %d\n",S[i].name,S[i].time);
	  s_tail++;
	  fnum++;
	}
      else
	{
	  time_spend+= qua;
	  S[s_tail].speed = S[i].speed - qua;
	  strcpy(S[s_tail].name,S[i].name);
	  // printf("%s  %d\n",S[s_tail].name,S[s_tail].speed);
	  s_tail++;
	}
      if(fnum==num) break;
    }
  return 0;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #Include; did you mean #include?
    1 | #Include <stdio.h>
      |  ^~~~~~~
      |  include
main.c: In function 'main':
main.c:18:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   18 |   scanf("%d %d",&num,&qua);
      |   ^~~~~
main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    3 | #include <string.h>
  +++ |+#include <stdio.h>
    4 | typedef struct {
main.c:18:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   18 |   scanf("%d %d",&num,&qua);
      |   ^~~~~
main.c:18:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:25:13: error: 'EOF' undeclared (first use in this function)
   25 |       if(z==EOF) break;
      |             ^~~
main.c:25:13: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:25:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:35:13: error: 'tail' undeclared (first use in this function); did you mean 's_tail'?
   35 |           S[tail].speed = S[i].speed;
      |             ^~~~
      |             s_tail
main.c:38:11: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   38 |           printf("%s %d\n",S[i].name,S[i].time);
      |           ^~~~~~
main.c:38:11: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:38:11: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:38:11: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAX 100001
#define QMAX 1000
 
//構造体
typedef struct {
  char name[10];
  int t;
}Process;
  
//グローバル変数
Process Q[MAX];

//プロトタイプ宣言
void enqueue(Process);
Process dequeue(void);
  
int main(void){
  Process u;
  int n,q;
  int ttime;
  int i,j;

  scanf("%d %d", &n, &q);
  
  //プロセスをエンキューする
  for ( i = 0; i < n; i++){
    scanf("%s %d", u.name, &u.t);
    enqueue(u);
  }

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

    //プロセスを１つずつ入れていく    
void enqueue(Process x){
  
  Q[tail] = x;
  if(tail + 1 == MAX){
    tail = 0;
  }
  else{
    tail++;
  }
}
  
//プロセスを１つずつ返す
Process dequeue(void){
    
  Process x = Q[head];

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

  return x;        
}

Compiler output:
main.c: In function 'enqueue':
main.c:53:5: error: 'tail' undeclared (first use in this function)
   53 |   Q[tail] = x;
      |     ^~~~
main.c:53:5: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'dequeue':
main.c:65:17: error: 'head' undeclared (first use in this function)
   65 |   Process x = 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;
	tail++;
	if(tail==LEN){
		tail=1;
	}
}

P dequeue(){
	if(head==LEN){
		head=1;
	}
	head++;
}


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

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

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

	  else{
		  Q[head].t=Q[head].t-q;
		  elaps=elaps+q;
		  enqueue(Q[head]);
	  }
	  if(head==tail)break;
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:30:17: error: expected expression before ',' token
   30 |   int elaps = 0;, c;
      |                 ^
main.c:30:19: error: 'c' undeclared (first use in this function)
   30 |   int elaps = 0;, c;
      |                   ^
main.c:30:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:35:1: error: stray '\343' in program
   35 | <U+3000>c=1;
      | ^~~~~~~~
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;
	tail++;
	if(tail==LEN){
		tail=1;
	}
}

P dequeue(){
	if(head==LEN){
		head=1;
	}
	head++;
}


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

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

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

	  else{
		  Q[head].t=Q[head].t-q;
		  elaps=elaps+q;
		  enqueue(Q[head]);
	  }
	  if(head==tail)break;
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:1: error: stray '\343' in program
   35 | <U+3000>c=1;
      | ^~~~~~~~
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;
	tail++;
	if(tail==LEN){
		tail=1;
	}
}

P dequeue(){
	if(head==LEN){
		head=1;
	}
	head++;
}


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

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

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

	  else{
		  Q[head].t=Q[head].t-q;
		  elaps=elaps+q;
		  enqueue(Q[head]);
	  }
	  if(head==tail)break;
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:1: error: stray '\343' in program
   35 | <U+3000>c=1;
      | ^~~~~~~~
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;
	tail++;
	if(tail==LEN){
		tail=1;
	}
}

P dequeue(){
	if(head==LEN){
		head=1;
	}
	head++;
}


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

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

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

	  else{
		  Q[head].t=Q[head].t-q;
		  elaps=elaps+q;
		  enqueue(Q[head]);
	  }
	  if(head==tail)break;
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:1: error: stray '\343' in program
   35 | <U+3000>c=1;
      | ^~~~~~~~
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;

int noelm(void);
void enqueue(P);
P dequeue(void);

int moelm(void){
  if(head == tail) return 1;
  else retrun 1;

}

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

P dequeue(void){
  P de;
  de=Q[head];
  if(head != LEN) head++;
  else head=1;
  return de;

}


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);
    enqueue(Q);
  }

Compiler output:
main.c: In function 'moelm':
main.c:20:8: error: 'retrun' undeclared (first use in this function)
   20 |   else retrun 1;
      |        ^~~~~~
main.c:20:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:14: error: expected ';' before numeric constant
   20 |   else retrun 1;
      |              ^~
      |              ;
main.c: In function 'main':
main.c:49:13: error: incompatible type for argument 1 of 'enqueue'
   49 |     enqueue(Q);
      |             ^
      |             |
      |             P * {aka struct pp *}
main.c:24:16: note: expected 'P' {aka 'struct pp'} but argument is of type 'P *' {aka 'struct pp *'}
   24 | void enqueue(P x){
      |              ~~^
main.c:50:3: error: expected declaration or statement at end of input
   50 |   }
      |   ^
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=0, tail, n;

void enqueue(P x){
  strcpy( Q[tail].name,x.name);
  Q[tail].t=x.t;
  tail++;
}


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

    if(Q[i].t>q){
      Q[i].t-=q;
      enqueue(Q[i]);
      elaps+=q;

    }

    else if(Q[i].t<=q){

      elaps+=Q[i].t;
      printf("%s %d\n",Q[i].name,elaps);
      l++;
      if(l==n)brea   }
    i++;

  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:44:15: error: 'brea' undeclared (first use in this function)
   44 |       if(l==n)brea   }
      |               ^~~~
main.c:44:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:44:19: error: expected ';' before '}' token
   44 |       if(l==n)brea   }
      |                   ^  ~
      |                   ;
Language: C

int sum=0, tail=0, n,c=0;

void enqueue(int,int);

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

void enqueue(int q,int i)
{
  int y;
  y = Q[i].t - q;
  if(y<=0)
    {
      sum+=Q[i].t;
      printf("%s %d\n",Q[i].name,sum);
      c++;
    }
  else
    {
      sum+=q;
      tail = tail + 1;
      strcpy(Q[tail].name,Q[i].name);
      Q[tail].t = y;
      
    }
}

Compiler output:
main.c: In function 'main':
main.c:7:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    7 |   scanf("%d%d",&n,&q);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int sum=0, tail=0, n,c=0;
main.c:7:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    7 |   scanf("%d%d",&n,&q);
      |   ^~~~~
main.c:7:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:17: error: 'Q' undeclared (first use in this function)
   10 |     scanf("%s", Q[i].name);
      |                 ^
main.c:10:17: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'enqueue':
main.c:26:7: error: 'Q' undeclared (first use in this function)
   26 |   y = Q[i].t - q;
      |       ^
main.c:30:7: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   30 |       printf("%s %d\n",Q[i].name,sum);
      |       ^~~~~~
main.c:30:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:30:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:30:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:37:7: error: implicit declaration of function 'strcpy' [-Wimplicit-function-declaration]
   37 |       strcpy(Q[tail].name,Q[i].name);
      |       ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strcpy'
  +++ |+#include <string.h>
    1 | int sum=0, tail=0, n,c=0;
main.c:37:7: warning: incompatible implicit declaration of built-in function 'strcpy' [-Wbuiltin-declaration-mismatch]
   37 |       strcpy(Q[tail].name,Q[i].name);
      |       ^~~~~~
main.c:37:7: note: include '<string.h>' or provide a declaration of 'strcpy'
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=1;
  else tail++;
}

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

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

Compiler output:
main.c: In function 'dequeue':
main.c:21:3: error: unknown type name 'N'
   21 |   N x;
      |   ^
main.c:22:5: error: incompatible types when assigning to type 'int' from type 'P' {aka 'struct pp'}
   22 |   x=Q[head];
      |     ^
main.c:25:10: error: incompatible types when returning type 'int' but 'P' {aka 'struct pp'} was expected
   25 |   return x;
      |          ^
Language: C

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

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

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==LEN)tail=1;
else tail++;
}

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

int main(){
int elaps=0;,c,i,q;
P u;
scanf("%d %d",&n,&q);
for(i=1;i<=n;i++)scanf("%s %d",Q[i].name,&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:29:13: error: expected expression before ',' token
   29 | int elaps=0;,c,i,q;
      |             ^
main.c:29:14: error: 'c' undeclared (first use in this function)
   29 | int elaps=0;,c,i,q;
      |              ^
main.c:29:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:29:16: error: 'i' undeclared (first use in this function)
   29 | int elaps=0;,c,i,q;
      |                ^
main.c:29:18: error: 'q' undeclared (first use in this function)
   29 | int elaps=0;,c,i,q;
      |                  ^
main.c:37:2: error: invalid operands to binary - (have 'P' {aka 'struct pp'} and 'P' {aka 'struct pp'})
   37 | u-dequeue();
      |  ^~~~~~~~~~
      |   |
      |   P {aka struct pp}
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;
  tail++;
}

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


int main(){
  int elaps = 0;
  int i, q = 0;
  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){
    if(Q[head].t > q){
      u = Q[head];
      u.t = Q[head].t - q;
      enqueue(u);
    }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:45:1: error: expected declaration or statement at end of input
   45 | }
      | ^
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;
  tail++;
}

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


int main(){
  int elaps = 0;
  int i, q = 0;
  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){
    if(Q[head].t > q){
      u = Q[head];
      u.t = Q[head].t - q;
      enqueue(u);
    }

   else{
      elaps =	elaps +	q - Q[head].t;
      printf("&s %d\n",Q[head].name,head*q-elaps);
    }

  return 0;
}

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

#include<stdio.h>
#include<string.h>
#define LEN 100005
int min(int a, int b){return a<b?a:b;}
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 == LEN) tail = 1;
  else tail++;
}

P dequeue(){
  P x = Q[head];
  if(head==LEN) head = 1;
  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);
  }
  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{
      pritnf("%s %d\n",u.name,elaps);
    }
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:46:7: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   46 |       pritnf("%s %d\n",u.name,elaps);
      |       ^~~~~~
      |       printf
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;
  tail++;
  if(LEN < tail) tail = 0;

  return x;
}

P dequeue(){
  P x;
  x = Q[head];
  head++;
  if(LEN < head) head = 0;

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

Compiler output:
main.c: In function 'enqueue':
main.c:18:10: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   18 |   return x;
      |          ^
main.c:13:6: note: declared here
   13 | void enqueue(P x){
      |      ^~~~~~~
main.c: In function 'main':
main.c:50:7: error: implicit declaration of function 'enpueue'; did you mean 'enqueue'? [-Wimplicit-function-declaration]
   50 |       enpueue(u);
      |       ^~~~~~~
      |       enqueue
Language: C

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

void push(int); 
int pop(); 
int isempty();
int dtoi(char); 
void print_stack(); 

int stack[max+1],p;

main()
{
  char c;
  p = 0;

  printf("Input data by Reverse Polish Notation: ");

  
  for(;c != '\n';){
    c = getchar();

    if(c >= '1' && c <= '9'){
      push(dtoi(c));
    }

    if(c == '+'){
     push(pop() + pop());
    }
   else if(c == '-'){
     push(pop() - pop());
    }
   else if(c == '*'){
     push(pop() * pop());
    }
   else if(c == '/'){
     push(pop() / pop());
    }
    print_stack();
  }
  printf("Answer: %d\n",stack[0]);
}

void push(int v)// ?π???√??§???°??? x §????√????°?∞??÷??§?√÷§?°?
{
  stack[p++] = v;
}

int pop(int v)// ?π???√??§´§???°???§????√??°?∞??÷??§???§?°?§?§?°¢§Ω§?§??÷§π
{
  if(isempty() == 0) return stack[--p];
  else if(isempty() == 1) exit(1);
}

int isempty() // ?π???√??§¨∂?§´§??????√??°£∂?§?§? 1°¢§Ω§¶§?§?§§§?§? 0 °£
{
  if(p == 0) return 1;
  else return 0;
}


int dtoi(char c) // ??????§?§?§?§?????§??∞????§??—\π °???°? '5' ¢? 5°?
{
  if(c == '1') return 1;
  else if( c == '2') return 2;
  else if( c == '3') return 3;
  else if( c == '4') return 4;
  else if( c == '5') return 5;
  else if( c == '6') return 6;
  else if( c == '7') return 7;
  else if( c == '8') return 8;
  else if( c == '9') return 9;
}

void print_stack() // ?π???√??§?√???§?…Ω??
{
  int i;

  for(i=0; i<p; i++){
    printf("%d ",stack[i]);
  }
  printf("\n");
}

Compiler output:
main.c:10:11: error: 'max' undeclared here (not in a function)
   10 | int stack[max+1],p;
      |           ^~~
main.c:12:1: error: return type defaults to 'int' [-Wimplicit-int]
   12 | main()
      | ^~~~
Language: C

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

void push(int); 
int pop(); 
int isempty();
int dtoi(char); 
void print_stack(); 

int stack[max+1],p;

int main()
{
  char c;
  p = 0;

  printf("Input data by Reverse Polish Notation: ");

  
  for(;c != '\n';){
    c = getchar();

    if(c >= '1' && c <= '9'){
      push(dtoi(c));
    }

    if(c == '+'){
     push(pop() + pop());
    }
   else if(c == '-'){
     push(pop() - pop());
    }
   else if(c == '*'){
     push(pop() * pop());
    }
   else if(c == '/'){
     push(pop() / pop());
    }
    print_stack();
  }
  printf("Answer: %d\n",stack[0]);
}

void push(int v)// ?π???√??§???°??? x §????√????°?∞??÷??§?√÷§?°?
{
  stack[p++] = v;
}

int pop(int v)// ?π???√??§´§???°???§????√??°?∞??÷??§???§?°?§?§?°¢§Ω§?§??÷§π
{
  if(isempty() == 0) return stack[--p];
  else if(isempty() == 1) exit(1);
}

int isempty() // ?π???√??§¨∂?§´§??????√??°£∂?§?§? 1°¢§Ω§¶§?§?§§§?§? 0 °£
{
  if(p == 0) return 1;
  else return 0;
}


int dtoi(char c) // ??????§?§?§?§?????§??∞????§??—\π °???°? '5' ¢? 5°?
{
  if(c == '1') return 1;
  else if( c == '2') return 2;
  else if( c == '3') return 3;
  else if( c == '4') return 4;
  else if( c == '5') return 5;
  else if( c == '6') return 6;
  else if( c == '7') return 7;
  else if( c == '8') return 8;
  else if( c == '9') return 9;
}

void print_stack() // ?π???√??§?√???§?…Ω??
{
  int i;

  for(i=0; i<p; i++){
    printf("%d ",stack[i]);
  }
  printf("\n");
}

Compiler output:
main.c:10:11: error: 'max' undeclared here (not in a function)
   10 | int stack[max+1],p;
      |           ^~~
Language: C

#include<stdio.h>
#include<string.h>
int main(){
  int i,ko,kuontamu,time[50000],j=0,goukei=0,dai2;
  char s[50001][10];
  scanf("%d%d",&ko,&kuontamu);
  for(i=0;i<ko;i++){
    scanf("%s%d",&s[i][0],&time[i]);
  }
  while(1){
    time[j]-=kuontamu;
    if(time[j]<=0){
      goukei+=(kuontamu+time[j]);
      time[j]=goukei;
      printf("%s %d\n",s[j],time[j]);
      j++;
    }
    else if(time[j]>0){
      goukei+=kuontamu;
      dai2=time[j];
      strcpy(s[50000],s[j]);
      for(i=j;i<ko-1;i++){
	time[i]=time[i+1];
	strcpy(s[i],s[i+1]);
      }
      time[ko-1]=dai2;
      strcpy(s[ko-1],s[50000]);
    }
    if(j>=ko)break;
  }
  return 0;

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

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

typedef struct pp{
	char mane[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:
a.cc: In function 'int main()':
a.cc:32:34: error: 'P' {aka 'struct pp'} has no member named 'name'
   32 |                 scanf("%s", Q[i].name);
      |                                  ^~~~
a.cc:44:44: error: 'P' {aka 'struct pp'} has no member named 'name'
   44 |                         printf("%s %d\n",u.name,elaps);
      |                                            ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
struct pro{string x;int y;};
int main(){
	int n,time = 0,rim,sougo = 0;
	cin>>n>>rim;
	pro aho[n]; 
	aho[n].y = ;
	pro v;
	for(int i = 0;i<n;i++){
		cin>>aho[i].x>>aho[i].y;
	}
	for(int i = 0;i<n;i++){
		sougo += aho[i].y;
	}
	int i = 0;
	while(time<=sougo && i<n){
		if(aho[i].y >rim && i<n){
			time += rim;
			aho[i].y -= rim;
			pro  v; 
			v = aho[i];
			for(int j = i;j<n-1;j++){
				aho[j] = aho[j+1];
			}
			aho[n-1] = v;
		}
		else if(aho[i].y<=rim){
			time += aho[i].y;
			aho[i].y = time;
			i++;
		}
			}
	for(int i = 0;i<n;i++){
		cout<<aho[i].x<<" "<<aho[i].y<<endl;
	}	

}	


Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: expected primary-expression before ';' token
    8 |         aho[n].y = ;
      |                    ^
Language: C++

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

using namespace std;
int LEN = 1000000;

struct P{
  char name[100];
  int time;
};

P Q[MAX];
int head = 0;
int tail = 0;

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 argc, const char * argv[]) {
  int n, q;
  int elaps = 0;

  cin >> n >> q;
  
  for(int i=0; i<n; i++){
    cin >> Q[i].name >> Q[i].time;
    enqueue(Q[i]);
  }
  tail = n;
  while(head != tail){
    P p = dequeue();
    int mtime = min(p.time, q);
    elaps += mtime;
    p.time -= mtime;
    if(p.time > 0){
      enqueue(p);
    }else{
      cout << p.name << " " << elaps << endl;
    }
  }
  
  return 0;
}



Compiler output:
a.cc:14:5: error: 'MAX' was not declared in this scope
   14 | P Q[MAX];
      |     ^~~
a.cc: In function 'void enqueue(P)':
a.cc:19:3: error: 'Q' was not declared in this scope
   19 |   Q[tail] = x;
      |   ^
a.cc: In function 'P dequeue()':
a.cc:24:9: error: 'Q' was not declared in this scope
   24 |   P x = Q[head];
      |         ^
a.cc: In function 'int main(int, const char**)':
a.cc:36:12: error: 'Q' was not declared in this scope
   36 |     cin >> Q[i].name >> Q[i].time;
      |            ^
Language: C++

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

int n,q;
pair<string,int> process,temp;
queue<pair<string,int>> Q;
void solve()
{
    int time=0;
    while(!Q.empty())
    {
        temp=Q.front();Q.pop();
        if(temp.second<=q)
        {
            time+=temp.second;
            cout<<temp.first<< ' ' <<time<<endl;
        }
        else
        {
            time+=q;
            temp.second-=q;
            Q.push(temp);
        }
    }
    
}
int main()
{
    cin>>n>>q;
    for(int i=0;i<n;i++)
    {
        cin >> process.firs t>> process.second;
        Q.push(process);
    }
    solve();
    return 1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:24: error: 'struct std::pair<std::__cxx11::basic_string<char>, int>' has no member named 'firs'; did you mean 'first'?
   34 |         cin >> process.firs t>> process.second;
      |                        ^~~~
      |                        first
Language: C++

#include <string>
#include <stack>
#include <stdlib.h>
#include <iostream>
#include <queue>
#include <utility>
using namespace std;

int main()
{
    cin>>n>>q;
    for(int i=0;i<n;i++)
    {
        cin>>process1.first>>process1.second;
        Q.push(process1);
    }
    while(!Q.empty())
    {
        process1=Q.front();Q.pop();
        if(process1.second<=q)
        {
            times+=process1.second;
            cout<<process1.first<<" "<<times<<endl;
        }
        else
        {
            times+=q;
            process1.second-=q;
            Q.push(process1);
        }
    }
    return 1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'n' was not declared in this scope
   11 |     cin>>n>>q;
      |          ^
a.cc:11:13: error: 'q' was not declared in this scope
   11 |     cin>>n>>q;
      |             ^
a.cc:14:14: error: 'process1' was not declared in this scope
   14 |         cin>>process1.first>>process1.second;
      |              ^~~~~~~~
a.cc:15:9: error: 'Q' was not declared in this scope
   15 |         Q.push(process1);
      |         ^
a.cc:17:12: error: 'Q' was not declared in this scope
   17 |     while(!Q.empty())
      |            ^
a.cc:19:9: error: 'process1' was not declared in this scope
   19 |         process1=Q.front();Q.pop();
      |         ^~~~~~~~
a.cc:22:13: error: 'times' was not declared in this scope; did you mean 'timex'?
   22 |             times+=process1.second;
      |             ^~~~~
      |             timex
a.cc:27:13: error: 'times' was not declared in this scope; did you mean 'timex'?
   27 |             times+=q;
      |             ^~~~~
      |             timex
Language: C++

#include <string>
#include <stack>
#include <stdlib.h>
#include <iostream>
#include <queue>
#include <utility>
using namespace std;


#if 0
queue<pair<string, int>>はダメです。queue<pair<string, int> >の中の’’は必要です。
#endif
pair<string, int> process;
queue<pair<string, int> > Q;
int main()
{
	int j = 0, times = 0;
    int n, q;
	cin >> n >> q;
	for (int i = 0; i<n; i++)
	{
		cin >> process.first >> process.second;
		Q.push(process);
	}
	while (!Q.empty()) {
		process = Q.front(); Q.pop();
		if (process.second > q) {
			process.second -= q;
			times += t;
			Q.push(process);
		}
		else {
			times += process.second;
			cout << process.first << " " << times << endl;
		}
	}
	return 0;
}


Compiler output:
a.cc:11:25: error: extended character 。 is not valid in an identifier
   11 | queue<pair<string, int>>はダメです。queue<pair<string, int> >の中の’’は必要です。
      |                         ^
a.cc:11:62: error: extended character ’ is not valid in an identifier
   11 | queue<pair<string, int>>はダメです。queue<pair<string, int> >の中の’’は必要です。
      |                                                              ^
a.cc:11:62: error: extended character ’ is not valid in an identifier
a.cc:11:62: error: extended character 。 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:29:34: error: 't' was not declared in this scope
   29 |                         times += t;
      |                                  ^
Language: C++

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

int main(){
    int n,q,t;
    string name;
    queue<pair<string,int>>Q;
    cin>>n>>q;
    for(int  i=0;i<n;i++){
        cin>>name>>t;
        Q.push(make_pair(name,t));
    }
    pair<string,int>u;
    int elaps=0,a;
    while(!Q=empty()){
        u=Q.front();Q.pop();
        a=min(u.second,q);
        u.second-=a;
        elaps+=a;
        if(u.second>0){
          Q.push(u);
        }else{
            cout<<u.first<<" "<<elaps<<endl;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: no match for 'operator!' (operand type is 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >')
   17 |     while(!Q=empty()){
      |           ^~
a.cc:17:11: note: candidate: 'operator!(bool)' (built-in)
a.cc:17:11: note:   no known conversion for argument 1 from 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >' to 'bool'
a.cc:17:19: error: no matching function for call to 'empty()'
   17 |     while(!Q=empty()){
      |              ~~~~~^~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:282:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.empty()) std::empty(const _Container&)'
  282 |     empty(const _Container& __cont) noexcept(noexcept(__cont.empty()))
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:282:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:292:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr bool std::empty(const _Tp (&)[_Nm])'
  292 |     empty(const _Tp (&)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:292:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:302:5: note: candidate: 'template<class _Tp> constexpr bool std::empty(initializer_list<_Tp>)'
  302 |     empty(initializer_list<_Tp> __il) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:302:5: note:   candidate expects 1 argument, 0 provided
Language: C++

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

int main(){
    int n,q,t;
    string name;
    queue<pair<string,int> >Q;
    cin>>n>>q;
    for(int  i=0;i<n;i++){
        cin>>name>>t;
        Q.push(make_pair(name,t));
    }
    pair<string,int>u;
    int elaps=0,a;
    while(!Q=empty()){
        u=Q.front();Q.pop();
        a=min(u.second,q);
        u.second-=a;
        elaps+=a;
        if(u.second>0){
          Q.push(u);
        }else{
            cout<<u.first<<" "<<elaps<<endl;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: no match for 'operator!' (operand type is 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >')
   17 |     while(!Q=empty()){
      |           ^~
a.cc:17:11: note: candidate: 'operator!(bool)' (built-in)
a.cc:17:11: note:   no known conversion for argument 1 from 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >' to 'bool'
a.cc:17:19: error: no matching function for call to 'empty()'
   17 |     while(!Q=empty()){
      |              ~~~~~^~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:282:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.empty()) std::empty(const _Container&)'
  282 |     empty(const _Container& __cont) noexcept(noexcept(__cont.empty()))
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:282:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:292:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr bool std::empty(const _Tp (&)[_Nm])'
  292 |     empty(const _Tp (&)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:292:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:302:5: note: candidate: 'template<class _Tp> constexpr bool std::empty(initializer_list<_Tp>)'
  302 |     empty(initializer_list<_Tp> __il) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:302:5: note:   candidate expects 1 argument, 0 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
  int n,q,y;
  string x;
  cin >> n >> q;
  queue<pair<string,int> > a;
  pair<string,int> b;
  for(int i=0;i<n;i++){
    cin >> b.first >> b.second;
    a.push(b);
  }
  while(! a.empty()){
    b=a.front();
    if(b.second<=q){
      cout << b.first << ' ' << b.second << endl;
    }
    else{
      b.first=b.first;
      b.secoond=b.second-q;
}
  }
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'struct std::pair<std::__cxx11::basic_string<char>, int>' has no member named 'secoond'; did you mean 'second'?
   21 |       b.secoond=b.second-q;
      |         ^~~~~~~
      |         second
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
  int n,q,y,t;
  string x;
  cin >> n >> q;
  queue<pair<string,int> > a;
  pair<string,int> b;
  for(int i=0;i<n;i++){
    cin >> b.first >> b.second;
    a.push(b);
  }
  while(! a.empty()){
    b=a.front();
    if(b.second<=q){
      t+=b.second;
      cout << b.first << ' ' << t  << endl;
      a.pop();
    }
    else{
      b.second=b.second-q;
      a.pop();
      a.push(b);
      t+=q
}
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:11: error: expected ';' before '}' token
   25 |       t+=q
      |           ^
      |           ;
   26 | }
      | ~
Language: C++

//#include <algorithm>
#include <iostream>
#include <vector>

int main(){
    int n, q;
    std::cin >> n >> q;

    std::vector<std::string> names(n);
    std::vector<int> times(n);
    int val, buf, totalTime = 0;
    for(int i = 0; i < n; ++i){
        std::cin >> names.at(i) >> val;
        buf = std::min(q, val);
        totalTime += buf;
        if(val <= 1){
            std::cout << names.at(i) << " " << totalTime << std::endl;
        }
        times.at(i) = val - buf;        
    }

    while(1){
        std::vector<int>::iterator itr = std::find(times.begin(), times.end(), [] (int elem) {return 0 != elem;});

        if(times.end() != itr){
            break;
        }else{
            while(times.end() != itr){
                buf = std::min(q, *itr);
                *itr -= buf;
                totalTime += buf;
                if(0 == *itr){
                    int i = std::distance(times.begin(), itr);
                    std::cout << names.at(i) << " " << totalTime << std::endl;
                }
                ++itr;
            }
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:51: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, main()::<lambda(int)>)'
   23 |         std::vector<int>::iterator itr = std::find(times.begin(), times.end(), [] (int elem) {return 0 != elem;});
      |                                          ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:23:51: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   23 |         std::vector<int>::iterator itr = std::find(times.begin(), times.end(), [] (int elem) {return 0 != elem;});
      |                                          ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<queue>
using namespace std;
struct process{
	char name[11];
	int time;
	process(char n[], int t){strcpy(name, n); time = t;}
};

int main(){
	char nm[11];
	int i, n, t, q, t_elapsed = 0;
	int *tp;
	queue<process> prcs;
	
	cin >> n >> q;
	for(i=0;i<n;i++){
		cin >> nm >> t;
		prcs.push(process(nm, t));
	}
	while(!prcs.empty()){
		tp = &(prcs.front().time);
		if(*tp <= q){
			t_elapsed += *tp;
			cout << prcs.front().name << " " << t_elapsed << endl;
			prcs.pop();
		}else{
			t_elapsed += q;
			*tp -= 100;
			prcs.push(prcs.front());
			prcs.pop();
		}
	}
	return 0;
}

Compiler output:
a.cc: In constructor 'process::process(char*, int)':
a.cc:7:34: error: 'strcpy' was not declared in this scope
    7 |         process(char n[], int t){strcpy(name, n); time = t;}
      |                                  ^~~~~~
a.cc:3:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<queue>
  +++ |+#include <cstring>
    3 | using namespace std;