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

#include
#include
#define LEN 100005

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

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

void enqueue(P x){
  int i;
  P a;
 a=Q[0]=

}

P dequeue(){

}


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

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

  
  return 0;
}



Compiler output:
main.c:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
main.c:2:9: error: #include expects "FILENAME" or <FILENAME>
    2 | #include
      |         ^
main.c: In function 'enqueue':
main.c:18:1: error: expected expression before '}' token
   18 | }
      | ^
main.c: In function 'main':
main.c:29:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   29 |   scanf("%d %d", &n, &q);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #include
main.c:29:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   29 |   scanf("%d %d", &n, &q);
      |   ^~~~~
main.c:29:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
Language: C

#include
#include
#define LEN 100005

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

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

void enqueue(P x,P y){
  int i;
  P a;
  a=x;
  x=y;
  y=a;

}

P dequeue(elaps){
  int i;
  
  for(i=0;i<n-elaps;i++){


  }
}


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);
  }
  Q[0].t=Q[0].t-q;
  if(Q[0].t<q){
    elaps++;
    dequeue(elaps);
  }
  for(i=0;i<n-1-elaps;i++){
    enqueue(Q[i],Q[i+1]);
  }
  return 0;
}



Compiler output:
main.c:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
main.c:2:9: error: #include expects "FILENAME" or <FILENAME>
    2 | #include
      |         ^
main.c: In function 'dequeue':
main.c:22:3: error: type of 'elaps' defaults to 'int' [-Wimplicit-int]
   22 | P dequeue(elaps){
      |   ^~~~~~~
main.c: In function 'main':
main.c:36:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   36 |   scanf("%d %d", &n, &q);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #include
main.c:36:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   36 |   scanf("%d %d", &n, &q);
      |   ^~~~~
main.c:36:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
Language: C

// AOJ ALDS1_3_B Queue
// 2018.4.30 bal4u

#include <stdio.h>

#define MAX_N 100002

typedef struct { char *p; int tm; } Q;
Q que[(MAX_N<<1)+2]; int top, end;
char name[MAX_N][20];

char buf[20], *p;
int in()
{
	int n = 0;
	while (*p >= '0') n = 10*n + (*p++ & 0xf);
	p++;
	return n;
}

int main()
{
	int  n, q, tm, i;
	Q  t;



Compiler output:
main.c: In function 'main':
main.c:24:9: error: expected declaration or statement at end of input
   24 |         Q  t;
      |         ^
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 )equeue(u);
		else{
			printf("%s %d\n",u.name, elaps);
		}
	}
	
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:44:30: error: implicit declaration of function 'equeue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   44 |                 if( u.t > 0 )equeue(u);
      |                              ^~~~~~
      |                              dequeue
Language: C

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

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

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

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

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

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

int main(void){
	int ela=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=deq();
		c=min(q,u.t);
		u.t-=c;
		ela+=c;
		if(u.t>0)enq(u);
		else{
			printf("%s %d\n",u.name,ela);
		}
	}
	return 0;
}


Compiler output:
main.c:5:7: error: expected ';' before 'struct'
    5 | typedf struct pp{
      |       ^~~~~~~
      |       ;
main.c:10:1: error: unknown type name 'P'
   10 | P Q[len];
      | ^
main.c:13:10: error: expected declaration specifiers or '...' before 'P'
   13 | void enq(P x){
      |          ^
main.c:18:1: error: unknown type name 'P'
   18 | P deq(){
      | ^
main.c: In function 'deq':
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:32:32: error: request for member 'name' in something not a structure or union
   32 |                 scanf("%s",Q[i].name);
      |                                ^
main.c:33:33: error: request for member 't' in something not a structure or union
   33 |                 scanf("%d",&Q[i].t);
      |                                 ^
main.c:38:17: error: 'u' undeclared (first use in this function)
   38 |                 u=deq();
      |                 ^
main.c:42:26: error: implicit declaration of function 'enq' [-Wimplicit-function-declaration]
   42 |                 if(u.t>0)enq(u);
      |                          ^~~
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, p;
	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:19:9: error: unknown type name 'p'
   19 |         p x = Q[head];
      |         ^
main.c:19:15: error: incompatible types when initializing type 'int' using type 'P' {aka 'struct pp'}
   19 |         p x = Q[head];
      |               ^
main.c:21:16: error: incompatible types when returning type 'int' but 'P' {aka 'struct pp'} was expected
   21 |         return x;
      |                ^
main.c: In function 'main':
main.c:30:29: error: 'q' undeclared (first use in this function)
   30 |         scanf("%d %d", &n, &q);
      |                             ^
main.c:30:29: note: each undeclared identifier is reported only once for each function it appears in
main.c:37:9: error: expected expression before 'while'
   37 |         while ( head != tail ){
      |         ^~~~~
Language: C

#include<stdio.h>
#include<cassert>
#include<string.h>
#define LEN 10000

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

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 min(int a, int b) {return a < b ? a : b;}
int max(int a, int b) {return a > b ? a : b;}

void trace(){
  int i;
  //  printf("(%d-%d)\n", head, tail);
  if ( head <= tail ){
    for ( i = head; i < tail; i++ ){
      printf("%s[%d] - ", Q[i].name, Q[i].t);
    }
    printf("\n");
  } else {
    for ( i = head; i <= LEN; i++ ){
      printf("%s[%d] - ", Q[i].name, Q[i].t);
    }
    for ( i = 1; i < tail; i++ ){
      printf("%s[%d] - ", Q[i].name, Q[i].t);
    }
    printf("\n");
  }
}

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

  while( head != tail ){
    //    trace();
    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:2:9: fatal error: cassert: No such file or directory
    2 | #include<cassert>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
#include<string>
#include<cstdlib>

#define N 100000
using namespace std;


typedef struct{
  int num[N];
  int head;
  int tail;
}Queque;


//grobal
Queque que;

  //add to head position
void push(int);
  //delete head position
void pop(void);
  //return now of stck
int front(void);


int main(){
  //format
  que.head=0;
  que.tail=0;

  int pasttime=0;
  int i,n,q,tim=0;
  string name[N];
  int finishcount=0;
  int flag[N];
  int st;

  //load n and q
  cin >>n>>q;

  //load name and time
  for(i=0;i<n;i++){
    cin >>name[i]>>tim;
    push(tim);
  }

  //format flag
  for(i=0;i<n;i++){
    flag[i]=0;
  }
  
  i=0;

  while(1){
    if(finishcount==n) break;
    //i->n i=0 continue
    else if(i==n){
      i=0;
      continue;
      }
    //flag=1 go next
      else if(flag[i]==1){
      i++;
      continue;
    }
    //load
    st=front();

    if(st>q){
      push(st-q);
      pop();
      pasttime+=q;
    }

    else{
      pop();
      pasttime+=st;
      flag[i]=1;
      finishcount++;
      //print
      cout <<name[i]<<" "<<pasttime<<endl;
    } 
    
    i++;
  }
    
  
  return 0;
  
}

  //add to head position
  void push(int x){
    que.num[que.tail]=x;
    que.tail++; 
 }
  //delete head position
  void pop(void){
    que.head++;
  }
  //return now of stck
  int front(void){
    return que.num[que.head];
  }

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

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

void enqueue(int index);
int dequeue(void);

int Q[1001];
int lastQ;

char name[1001][11];
int time[1001];

main(){

  int i, index;
  char inName[11];
  int inTime;
  int elapsedTime = 0;
  int n,q;

  firstQ = 0;
  lastQ = 0;

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

  for(i=0; i<n; i++){
    scanf("%s %d",inName,&inTime);

    // storage
    strcpy(char[i],inName);
    time[i] = inTime;

    enqueue(i);
  }

  while(n!=0){

    index = dequeue();

    time[index] -= q;
    elapsedTime += q;

    if(time[index] <= 0){

      elapsedTime += time[index];
      printf("%s %d\n",name[index],elapsedTime);
      n--;

    }else{

      enqueue(index);

    }

  }

  return 0;

}

void enqueue(int index){

  Q[++lastQ] = index;

}

int dequeue(void){

  int i,tmp = Q[0];

  for(i=0; i<lastQ; i++){
    Q[i] = Q[i+1];
  }

  return tmp;

}

Compiler output:
main.c:13:1: error: return type defaults to 'int' [-Wimplicit-int]
   13 | main(){
      | ^~~~
main.c: In function 'main':
main.c:21:3: error: 'firstQ' undeclared (first use in this function)
   21 |   firstQ = 0;
      |   ^~~~~~
main.c:21:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:30:12: error: expected expression before 'char'
   30 |     strcpy(char[i],inName);
      |            ^~~~
main.c:30:5: error: too few arguments to function 'strcpy'
   30 |     strcpy(char[i],inName);
      |     ^~~~~~
In file included from main.c:2:
/usr/include/string.h:141:14: note: declared here
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |              ^~~~~~
Language: C

#include<stdio.h>
#include<string.h>
int d;
int q;

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

Process Q[100000000];
int n;
int head=0, tail=0;


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

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

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


/*
  int i;
  for(i=0;i<q;i++,d++){
    Q[0].t--;
   if(Q[0].t<=0){
      if(Q[0].t==0){
	d++;
	printf("%s %d\n",Q[0].name,d);
	Q[0].t--;
      }
      return Q[0];
    }
    }





  int i;
  for(i=0;i<n;i++){
    Q[i]=Q[i+1];
  }
  Q[i-1]=x;*/

Compiler output:
/tmp/ccspBQPu.o: in function `enqueue':
main.c:(.text+0x7): relocation truncated to fit: R_X86_64_PC32 against symbol `head' defined in .bss section in /tmp/ccspBQPu.o
main.c:(.text+0xa2): relocation truncated to fit: R_X86_64_PC32 against symbol `head' defined in .bss section in /tmp/ccspBQPu.o
main.c:(.text+0xab): relocation truncated to fit: R_X86_64_PC32 against symbol `head' defined in .bss section in /tmp/ccspBQPu.o
/tmp/ccspBQPu.o: in function `dequeue':
main.c:(.text+0xc0): relocation truncated to fit: R_X86_64_PC32 against symbol `tail' defined in .bss section in /tmp/ccspBQPu.o
main.c:(.text+0xc9): relocation truncated to fit: R_X86_64_PC32 against symbol `tail' defined in .bss section in /tmp/ccspBQPu.o
main.c:(.text+0xcf): relocation truncated to fit: R_X86_64_PC32 against symbol `tail' defined in .bss section in /tmp/ccspBQPu.o
/tmp/ccspBQPu.o: in function `main':
main.c:(.text+0x194): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccspBQPu.o
main.c:(.text+0x276): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccspBQPu.o
main.c:(.text+0x3f0): relocation truncated to fit: R_X86_64_PC32 against symbol `head' defined in .bss section in /tmp/ccspBQPu.o
main.c:(.text+0x3f6): relocation truncated to fit: R_X86_64_PC32 against symbol `tail' defined in .bss section in /tmp/ccspBQPu.o
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
#include<string.h>
int d;
int q;

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

Process Q[100000000];
int n;
int head=0, tail=0;


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

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

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

Compiler output:
/tmp/ccyVrDdv.o: in function `enqueue':
main.c:(.text+0x7): relocation truncated to fit: R_X86_64_PC32 against symbol `head' defined in .bss section in /tmp/ccyVrDdv.o
main.c:(.text+0xa2): relocation truncated to fit: R_X86_64_PC32 against symbol `head' defined in .bss section in /tmp/ccyVrDdv.o
main.c:(.text+0xab): relocation truncated to fit: R_X86_64_PC32 against symbol `head' defined in .bss section in /tmp/ccyVrDdv.o
/tmp/ccyVrDdv.o: in function `dequeue':
main.c:(.text+0xc0): relocation truncated to fit: R_X86_64_PC32 against symbol `tail' defined in .bss section in /tmp/ccyVrDdv.o
main.c:(.text+0xc9): relocation truncated to fit: R_X86_64_PC32 against symbol `tail' defined in .bss section in /tmp/ccyVrDdv.o
main.c:(.text+0xcf): relocation truncated to fit: R_X86_64_PC32 against symbol `tail' defined in .bss section in /tmp/ccyVrDdv.o
/tmp/ccyVrDdv.o: in function `main':
main.c:(.text+0x194): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccyVrDdv.o
main.c:(.text+0x276): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccyVrDdv.o
main.c:(.text+0x3f0): relocation truncated to fit: R_X86_64_PC32 against symbol `head' defined in .bss section in /tmp/ccyVrDdv.o
main.c:(.text+0x3f6): relocation truncated to fit: R_X86_64_PC32 against symbol `tail' defined in .bss section in /tmp/ccyVrDdv.o
collect2: error: ld returned 1 exit status
Language: C

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

//構造体
typedef struct {
  char name[100];
  int t;
}Process;


//プロトタイプ宣言
void enqueue(Process);
Process dequeue(void);

//グローバル変数
Process Q[100000001];
int n,q;
int ttime;
int i,j;

int main(void){

  int count=0;
  Process stack[100001];

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

  //スケジュールの入力
  for ( i = 0; i < n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }

  for(i=0;i<n+j;i++){
  stack[count] = dequeue();
  if(stack[count].t != -1)
  enqueue(stack[count++]);
  }

  return 0;
}


//終了したプロセスを表示する
void enqueue(Process x){

  printf("%s %d\n",x.name,x.t);
}

Process dequeue(void){

  int flag=0;

    if(Q[i].t <= q){
      ttime += Q[i].t;
      Q[i].t = ttime;
      flag=1;
    } 
    else{
      ttime += q;
      Q[n+j].t = Q[i].t - q;
      strcpy(Q[n+j].name,Q[i].name);
      j++;
    }

    if(flag==0)
      Q[i].t = -1;

      return Q[i];
      
}

Compiler output:
/tmp/ccoTzqYN.o: in function `main':
main.c:(.text+0x16): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccoTzqYN.o
main.c:(.text+0x20): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccoTzqYN.o
main.c:(.text+0x3d): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccoTzqYN.o
main.c:(.text+0x4c): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccoTzqYN.o
main.c:(.text+0x8a): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccoTzqYN.o
main.c:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccoTzqYN.o
main.c:(.text+0xd9): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccoTzqYN.o
main.c:(.text+0xdf): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccoTzqYN.o
main.c:(.text+0xe5): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccoTzqYN.o
main.c:(.text+0xf3): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccoTzqYN.o
main.c:(.text+0x2a0): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

  }

  for(i=0;i<n+j;i++){
  stack[count] = dequeue();
  if(stack[count].t != -1)
  enqueue(stack[count++]);
  }
 
  return 0;
}
 
 
//終了したプロセスを表示する
void enqueue(Process x){
 
  printf("%s %d\n",x.name,x.t);
}
 
Process dequeue(void){
 
  int flag=0;
 
    if(Q[i].t <= q){
      ttime += Q[i].t;
      Q[i].t = ttime;
      flag=1;
    }
    else{
      ttime += q;
      Q[n+j].t = Q[i].t - q;
      strcpy(Q[n+j].name,Q[i].name);
      j++;
    }
 
    if(flag==0)
      Q[i].t = -1;
 
      return Q[i];
       
}

Compiler output:
main.c:1:3: error: expected identifier or '(' before '}' token
    1 |   }
      |   ^
main.c:3:3: error: expected identifier or '(' before 'for'
    3 |   for(i=0;i<n+j;i++){
      |   ^~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    3 |   for(i=0;i<n+j;i++){
      |            ^
main.c:3:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    3 |   for(i=0;i<n+j;i++){
      |                  ^~
main.c:9:3: error: expected identifier or '(' before 'return'
    9 |   return 0;
      |   ^~~~~~
main.c:10:1: error: expected identifier or '(' before '}' token
   10 | }
      | ^
main.c:14:14: error: unknown type name 'Process'
   14 | void enqueue(Process x){
      |              ^~~~~~~
main.c:19:1: error: unknown type name 'Process'
   19 | Process dequeue(void){
      | ^~~~~~~
main.c: In function 'dequeue':
main.c:23:8: error: 'Q' undeclared (first use in this function)
   23 |     if(Q[i].t <= q){
      |        ^
main.c:23:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:23:10: error: 'i' undeclared (first use in this function)
   23 |     if(Q[i].t <= q){
      |          ^
main.c:23:18: error: 'q' undeclared (first use in this function)
   23 |     if(Q[i].t <= q){
      |                  ^
main.c:24:7: error: 'ttime' undeclared (first use in this function)
   24 |       ttime += Q[i].t;
      |       ^~~~~
main.c:30:9: error: 'n' undeclared (first use in this function)
   30 |       Q[n+j].t = Q[i].t - q;
      |         ^
main.c:30:11: error: 'j' undeclared (first use in this function)
   30 |       Q[n+j].t = Q[i].t - q;
      |           ^
main.c:31:7: error: implicit declaration of function 'strcpy' [-Wimplicit-function-declaration]
   31 |       strcpy(Q[n+j].name,Q[i].name);
      |       ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strcpy'
  +++ |+#include <string.h>
    1 |   }
main.c:31:7: warning: incompatible implicit declaration of built-in function 'strcpy' [-Wbuiltin-declaration-mismatch]
   31 |       strcpy(Q[n+j].name,Q[i].name);
      |       ^~~~~~
main.c:31:7: note: include '<string.h>' or provide a declaration of 'strcpy'
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAX 100000
#define QMAX 1000
 
//構造体
typedef struct {
  char name[10];
  int t;
}Process;
  
//プロトタイプ宣言
void enqueue(Process);
Process dequeue(void);
  
//グローバル変数
Process Q[MAX];
int n,q;
int ttime;
int i;
int top,last;
  
int main(void){
  
  Process stack;
  
  scanf("%d %d", &n, &q);
  
  //スケジュールの入力
  for ( i = 0; i < n; i++){
    scanf("%s", stack.name);
    scanf("%d", &stack.t);
    enqueue(stack);
  }

  i=0;

  while(0 < n){

    stack = dequeue();

    if(stack.t <= q){
      printf("%s %d\n",stack.name,stack.t + ttime);
      --n;
    


    ttime += stack.t;
    }
    else{
      stack.t = stack.t - q;

      enqueue(stack);

      ttime += q;
    }
  }

  return 0;
}
    
//終了したプロセスを表示する
void enqueue(Process x){
  
  if(last+1 == MAX)
    last = 0;

  Q[last++] = x;
}
  
Process dequeue(void){

  if(head + 1 == MAX)
    head = 0;

 return Q[top++];
        
}

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

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAX 100000
#define QMAX 1000
 
//構造体
typedef struct {
  char name[10];
  int t;
}Process;
  
//プロトタイプ宣言
void enqueue(Process);
Process dequeue(void);
  
//グローバル変数
Process Q[MAX];
int n,q;
int ttime;
int i;
int top,last;
  
int main(void){
  
  Process stack;
  
  scanf("%d %d", &n, &q);
  
  //スケジュールの入力
  for ( i = 0; i < n; i++){
    scanf("%s", stack.name);
    scanf("%d", &stack.t);
    enqueue(stack);
  }

  i=0;

  while(0 < n){

    stack = dequeue();

    if(stack.t <= q){
      printf("%s %d\n",stack.name,stack.t + ttime);
      --n;
    


    ttime += stack.t;
    }
    else{
      stack.t = stack.t - q;

      enqueue(stack);

      ttime += q;
    }
  }

  return 0;
}
    
//終了したプロセスを表示する
void enqueue(Process x){
  
  if(last+1 == MAX)
    last = 0;

  Q[last++] = x;
}
  
Process dequeue(void){

  if(head + 1 == MAX)
    top = 0;

 return Q[top++];
        
}

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

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

struct node{
	int num;
	node* next;
	node* prev;
};

int main(){

	
	int order_num;
	char order[10];
	int val;
	node* p = (node*)malloc(sizeof(node));
	node* origin = p;
	cin >> order_num;
	int test = order_num;

	for(int i = 0; i < test; i++){
		cin >> order;	
		if(order[0] == 'i'){
			cin >> val;
			p->num = val;
			p->next = (node*)malloc(sizeof(node)); 
			p->next->prev = p;
			p = p->next;
		}else if(strcmp(order,"delete") == 0){
			cin >> val;
			node* p2 = origin;
			while(p2->next != NULL){
				if(p2->num == val){
					if(p2->prev == NULL){
						origin = origin->next;
						free(origin->prev);
						origin -> prev = NULL;
					}else{
						p2->next->prev = p2->prev;
						p2->prev->next = p2->next;
						free(p2);
						break;
					}
				}
				p2 = p2->next;
			}
		}else if(strcmp(order,"deleteFirst") == 0){
			p->prev = p->prev->prev;
			free(p->prev->next);
			p->prev->next = p;
		}else if(strcmp(order,"deleteLast") == 0){
			origin = origin->next;
			free(origin->prev);
			origin->prev = NULL;
		}
	}
	p = p->prev;
	while(p->prev != NULL){
		free(p->next);
		cout << p->num << " ";
		p = p->prev;
	}
	cout << p->num << endl;
	free(p);


	
	return 0;
}

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

int main(void){
  int n, q, count = 0;
  scanf("%d %d", &n, &q);
  int i = 0,j = 0,k = 0;
  for(k=0;k<n;k++)
    scanf("%s %d", l[k], &t[k]);

  while(j != n){
    if (i==n)
      i = 0;
    
    if(t[i] == 0){
      i++;
      continue;
    } else {
      if (t[i] - q > 0){
	t[i] = t[i] - q;
	count += q;
      }
      else{
	count += t[i];
	t[i] = 0;
	m[j] = l[i];
	p[j++] = count;
      }

      i++;
    }
    // if (j == n) break;
  }
  for(i = 0; i < n; i++){
    printf("%s %d\n", m[i], p[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |   scanf("%d %d", &n, &q);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void){
main.c:3:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |   scanf("%d %d", &n, &q);
      |   ^~~~~
main.c:3:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:20: error: 'l' undeclared (first use in this function)
    6 |     scanf("%s %d", l[k], &t[k]);
      |                    ^
main.c:6:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:27: error: 't' undeclared (first use in this function)
    6 |     scanf("%s %d", l[k], &t[k]);
      |                           ^
main.c:23:9: error: 'm' undeclared (first use in this function)
   23 |         m[j] = l[i];
      |         ^
main.c:24:9: error: 'p' undeclared (first use in this function)
   24 |         p[j++] = count;
      |         ^
main.c:32:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   32 |     printf("%s %d\n", m[i], p[i]);
      |     ^~~~~~
main.c:32:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:32:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:32:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
char l[100001][11]; //,*m[100000];
int t[100001]; //,p[100001];

int main(void){
  int n, q, count = 0;
  scanf("%d %d", &n, &q);
  int i = 0,j = 0,k = 0;
  for(k=0;k<n;k++)
    scanf("%s %d", l[k], &t[k]);

  while(j != n){
    if (i==n)
      i = 0;
    
    if(t[i] == 0){
      i++;
      continue;
    } else {
      if (t[i] - q > 0){
	t[i] = t[i] - q;
	count += q;
      }
      else{
	count += t[i];
	t[i] = 0;
	printf("%s %d\n", l[i], p[j++]);
	/*
	m[j] = l[i];
	p[j++] = count;
	*/
      }

      i++;
    }
    // if (j == n) break;
  }
  /*
  for(i = 0; i < n; i++){
    printf("%s %d\n", m[i], p[i]);
  }
  */
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:33: error: 'p' undeclared (first use in this function)
   27 |         printf("%s %d\n", l[i], p[j++]);
      |                                 ^
main.c:27:33: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

#define MAX 100000

struct queue{
  char name[11];
  int time;
};

queue Q[MAX];
int used[MAX];

int main(){
  int n,q,i,empty,p = 0,pos = 0,sum = 0;
  queue ans[MAX]; 

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

  empty = n;
  while(empty != 0){
    if(!used[p]){
      p++;
      if(p == n) p = 0;
      continue;
    }
    if(Q[p].time > q){
      Q[p].time -= q;
      sum += q;
    }else{
      sum += Q[p].time;
      Q[p].time = 0;

      used[p] = 0;
      empty--;
      strcpy(ans[pos].name,Q[p].name);
      ans[pos++].time = sum;
    }
   
    p++;
    if(p == n){
      p = 0;
    }
  }

  for(i = 0 ; i < n ; i++){
    printf("%s %d\n" ,ans[i].name,ans[i].time);
  }

  return 0;
}

Compiler output:
main.c:11:1: error: unknown type name 'queue'; use 'struct' keyword to refer to the type
   11 | queue Q[MAX];
      | ^~~~~
      | struct 
main.c: In function 'main':
main.c:16:3: error: unknown type name 'queue'; use 'struct' keyword to refer to the type
   16 |   queue ans[MAX];
      |   ^~~~~
      |   struct 
main.c:20:24: error: request for member 'name' in something not a structure or union
   20 |     scanf("%s %d" ,Q[i].name ,&Q[i].time);
      |                        ^
main.c:20:36: error: request for member 'time' in something not a structure or union
   20 |     scanf("%s %d" ,Q[i].name ,&Q[i].time);
      |                                    ^
main.c:31:12: error: request for member 'time' in something not a structure or union
   31 |     if(Q[p].time > q){
      |            ^
main.c:32:11: error: request for member 'time' in something not a structure or union
   32 |       Q[p].time -= q;
      |           ^
main.c:35:18: error: request for member 'time' in something not a structure or union
   35 |       sum += Q[p].time;
      |                  ^
main.c:36:11: error: request for member 'time' in something not a structure or union
   36 |       Q[p].time = 0;
      |           ^
main.c:40:22: error: request for member 'name' in something not a structure or union
   40 |       strcpy(ans[pos].name,Q[p].name);
      |                      ^
main.c:40:32: error: request for member 'name' in something not a structure or union
   40 |       strcpy(ans[pos].name,Q[p].name);
      |                                ^
main.c:41:17: error: request for member 'time' in something not a structure or union
   41 |       ans[pos++].time = sum;
      |                 ^
main.c:51:29: error: request for member 'name' in something not a structure or union
   51 |     printf("%s %d\n" ,ans[i].name,ans[i].time);
      |                             ^
main.c:51:41: error: request for member 'time' in something not a structure or union
   51 |     printf("%s %d\n" ,ans[i].name,ans[i].time);
      |                                         ^
Language: C

#include <stdio.h>
#include<string.h>
#define LEN 100000
 
typedef struct pp{
    char name[100];
    int t;
}P;
 
P Q[LEN+1];
int head = 1, tail = 0, n, empty = 0;
 
void push(P x){
    empty++;
    Q[++tail] = x;
     tail %= MAX;
}
 
P pop(){
    P res;
    empty--;
    res = Q[head++];
    head %= MAX;
    return res;
}
 
 
int main(){
    int time = 0, count = 0;
    int i, ms;
    P u;
    scanf("%d %d", &n, &ms);
 
    empty = n;
    tail = n;
 
    for ( i = 1; i <= n; i++){
        scanf("%s", Q[i].name);
        scanf("%d", &Q[i].t);
    }
 
    while(empty != 0){
 
        u = pop();
        if(u.t <= ms) {
            time += u.t;
            printf("%s %d\n", u.name, time);
        }
 
        else if(u.t > ms){
            time += ms;
            u.t -= ms;
            push(u);
        }
        else if(u.t == 0) continue;
    }
 
 
    return 0;
}

Compiler output:
main.c: In function 'push':
main.c:16:14: error: 'MAX' undeclared (first use in this function)
   16 |      tail %= MAX;
      |              ^~~
main.c:16:14: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'pop':
main.c:23:13: error: 'MAX' undeclared (first use in this function)
   23 |     head %= MAX;
      |             ^~~
Language: C

#include <stdio.h>
#include<string.h>
#define LEN 100000
 
typedef struct pp{
    char name[100];
    int t;
}P;
 
P Q[LEN+1];
int head = 1, tail = 0, n, empty = 0、;
 
void push(P x){
    empty++;
    Q[tail++] = x;
   tail %= LEN;
}
 
P pop(){
    P res;
    empty--;
    res = Q[head];
    if(head == n) head = 0;
    else head++;
    return res;
}
 
 
int main(){
    int time = 0, count = 0;
    int i, ms;
    P u;
    scanf("%d %d", &n, &ms);
 
    empty = n;
    tail = n;
 
    for ( i = 1; i <= n; i++){
        scanf("%s", Q[i].name);
        scanf("%d", &Q[i].t);
    }
 
    while(empty != 0){
 
        u = pop();
        if(u.t <= ms) {
            time += u.t;
            printf("%s %d\n", u.name, time);
        }
 
        else if(u.t > ms){
            time += ms;
            u.t -= ms;
            push(u);
        }
        else if(u.t == 0) continue;
    }
 
 
    return 0;
}

Compiler output:
main.c:11:37: error: stray '\343' in program
   11 | int head = 1, tail = 0, n, empty = 0<U+3001>;
      |                                     ^~~~~~~~
Language: C

#include <stdio.h>
#include<string.h>
#define LEN 100001
   
typedef struct pp{
    char name[100];
    int t;
}P;
   
P Q[LEN+1];
int head = 1, tail = 0, n, empty = 0;
   
void push(P x){
    Q[tail] = x;
    if(tail == n) tail = 0;
    else tail++;
}
   
P pop(){
    P res;
    res = Q[head];
    if(head == n) head = 0;
    else head++; 
    return res;
}
   
   
int main(){
    int time = 0, c = 0;
    int i, ms;
    P u;
    scanf("%d %d", &n, &ms);
   
    tail = n/2;   
    head = n/2;
   
    for ( i = 1; i <= n; i++){
        scanf("%s", Q[i].name);
        scanf("%d", &Q[i].t);
    }
   
    while(c != n){
   
        u = pop();
      
        if(u.t > ms) {
            time += ms;
            u.t -= ms;
            push(u);
        }

        else (u.t <= ms) {
            time += u.t;
            printf("%s %d\n", u.name, time);
            c++;
        }
   
    }
   
   
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:52:25: error: expected ';' before '{' token
   52 |         else (u.t <= ms) {
      |                         ^~
      |                         ;
Language: C

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

void printqueue(void){
  int i;
   
  for(i=head; i!=tail; i++){
    if(i==length){
      printf("%s %d ",Q[i].name,Q[i].tim);
      i=0;
      printf("\n");
    }
    printf("%s %d ",Q[i].name,Q[i].tim);
    printf("\n");
  }
 
}
   
P Q[LEN+1];
int head, tail , n;
   
void push(P x){
    Q[tail] = x;
    if(tail == n) tail = 0;
    else tail++;
}
   
P pop(){
    P res;
    res = Q[head];
    if(head == n) head = 0;
    else head++; 
    return res;
}
   
   
int main(){
    int time = 0, c = 0;
    int i, ms;
    P u;
    scanf("%d %d", &n, &ms);
   
    tail = n/2;   
    head = n/2;
   
    for ( i = 0; i <n; i++){
        scanf("%s", Q[i].name);
        scanf("%d", &Q[i].t);
    }
   
    while(c != n){
   
        u = pop();
      
        if(u.t > ms) {
            time += ms;
            u.t -= ms;
            push(u);
        }

        else {
            time += u.t;
            printf("%s %d\n", u.name, time);
            c++;
        }
   
    }
  
    return 0;
}

Compiler output:
main.c: In function 'printqueue':
main.c:13:9: error: 'head' undeclared (first use in this function)
   13 |   for(i=head; i!=tail; i++){
      |         ^~~~
main.c:13:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:18: error: 'tail' undeclared (first use in this function)
   13 |   for(i=head; i!=tail; i++){
      |                  ^~~~
main.c:14:11: error: 'length' undeclared (first use in this function)
   14 |     if(i==length){
      |           ^~~~~~
main.c:15:23: error: 'Q' undeclared (first use in this function)
   15 |       printf("%s %d ",Q[i].name,Q[i].tim);
      |                       ^
Language: C

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

void printqueue(void){
  int i;
   
  for(i=head; i!=tail; i++){
    if(i==n){
      printf("%s %d ",Q[i].name,Q[i].tim);
      i=0;
      printf("\n");
    }
    printf("%s %d ",Q[i].name,Q[i].tim);
    printf("\n");
  }
 
}
   
P Q[LEN+1];
int head, tail , n;
   
void push(P x){
    Q[tail] = x;
    if(tail == n) tail = 0;
    else tail++;
}
   
P pop(){
    P res;
    res = Q[head];
    if(head == n) head = 0;
    else head++; 
    return res;
}
   
   
int main(){
    int time = 0, c = 0;
    int i, ms;
    P u;
    scanf("%d %d", &n, &ms);
   
    tail = n/2;   
    head = n/2;
   
    for ( i = 0; i <n; i++){
        scanf("%s", Q[i].name);
        scanf("%d", &Q[i].t);
    }
   
    while(c != n){
   
        u = pop();
      
        if(u.t > ms) {
            time += ms;
            u.t -= ms;
            push(u);
        }

        else {
            time += u.t;
            printf("%s %d\n", u.name, time);
            c++;
        }
   
    }
  
    return 0;
}

Compiler output:
main.c: In function 'printqueue':
main.c:13:9: error: 'head' undeclared (first use in this function)
   13 |   for(i=head; i!=tail; i++){
      |         ^~~~
main.c:13:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:18: error: 'tail' undeclared (first use in this function)
   13 |   for(i=head; i!=tail; i++){
      |                  ^~~~
main.c:14:11: error: 'n' undeclared (first use in this function)
   14 |     if(i==n){
      |           ^
main.c:15:23: error: 'Q' undeclared (first use in this function)
   15 |       printf("%s %d ",Q[i].name,Q[i].tim);
      |                       ^
Language: C

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

void printqueue(void);
   
P Q[LEN+1];
int head, tail , n;
   
void push(P x){
    Q[tail] = x;
    if(tail == n) tail = 0;
    else tail++;
}
   
P pop(){
    P res;
    res = Q[head];
    if(head == n) head = 0;
    else head++; 
    return res;
}
   
   
int main(){
    int time = 0, c = 0;
    int i, ms;
    P u;
    scanf("%d %d", &n, &ms);
   
    tail = n/2;   
    head = n/2;
   
    for ( i = 0; i <n; i++){
        scanf("%s", Q[i].name);
        scanf("%d", &Q[i].t);
    }
   
    while(c != n){
   
        u = pop();
      
        if(u.t > ms) {
            time += ms;
            u.t -= ms;
            push(u);
        }

        else {
            time += u.t;
            printf("%s %d\n", u.name, time);
            c++;
        }
   
    }
  
    return 0;
}

void printqueue(void){
  int i;
   
  for(i=head; i!=tail; i++){
    if(i==n){
      printf("%s %d ",Q[i].name,Q[i].tim);
      i=0;
      printf("\n");
    }
    printf("%s %d ",Q[i].name,Q[i].tim);
    printf("\n");
  }
 
}

Compiler output:
main.c: In function 'printqueue':
main.c:70:37: error: 'P' {aka 'struct pp'} has no member named 'tim'
   70 |       printf("%s %d ",Q[i].name,Q[i].tim);
      |                                     ^
main.c:74:35: error: 'P' {aka 'struct pp'} has no member named 'tim'
   74 |     printf("%s %d ",Q[i].name,Q[i].tim);
      |                                   ^
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){
     tail++;
     Q[tail] = x;
}

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


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;
  head = 1;

  for(; head > tail; ){    
    if(Q[head].t > q){
      elaps += 100;
      Q[head].t -= 100; 
      enqueue(dequeue());

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

Compiler output:
main.c: In function 'dequeue':
main.c:20:17: error: expected ';' before '}' token
   20 | return Q[head-1]
      |                 ^
      |                 ;
   21 | }
      | ~
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){
     tail++;
     Q[tail] = x;
}

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


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;
  head = 1;

 
  
  return 0;
}

Compiler output:
main.c: In function 'dequeue':
main.c:20:17: error: expected ';' before '}' token
   20 | return Q[head-1]
      |                 ^
      |                 ;
   21 | }
      | ~
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){
     tail++;
     Q[tail] = x;
}

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


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;
  head = 1;

  while(head > tail){    
    if(Q[head].t > q){
      elaps += 100;
      Q[head].t -= 100; 
      enqueue(dequeue());

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

Compiler output:
main.c: In function 'dequeue':
main.c:20:17: error: expected ';' before '}' token
   20 | return Q[head-1]
      |                 ^
      |                 ;
   21 | }
      | ~
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){
     tail++;
     Q[tail] = x;
}

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


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;
  head = 1;

  while(head > tail){    
    if(Q[head].t > q){
      

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

Compiler output:
main.c: In function 'dequeue':
main.c:20:17: error: expected ';' before '}' token
   20 | return Q[head-1]
      |                 ^
      |                 ;
   21 | }
      | ~
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){
     tail++;
     Q[tail] = x;
}

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


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;
  head = 1;

  while(head > tail){    
    if(Q[head].t > q){
      elaps += 100;
      Q[head].t -= 100; 
      enqueue(dequeue());

    } else {
      
    }
  }
  
  return 0;
}

Compiler output:
main.c: In function 'dequeue':
main.c:20:17: error: expected ';' before '}' token
   20 | return Q[head-1]
      |                 ^
      |                 ;
   21 | }
      | ~
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){
     tail++;
     Q[tail] = x;
}

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


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;
  head = 1;

  while(head > tail){    
    
  }
  
  return 0;
}

Compiler output:
main.c: In function 'dequeue':
main.c:20:17: error: expected ';' before '}' token
   20 | return Q[head-1]
      |                 ^
      |                 ;
   21 | }
      | ~
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){
     
}

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


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;
  head = 1;

  while(head > tail){    
    if(Q[head].t > q){
      elaps += 100;
      Q[head].t -= 100; 
      enqueue(dequeue());

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

Compiler output:
main.c: In function 'dequeue':
main.c:19:17: error: expected ';' before '}' token
   19 | return Q[head-1]
      |                 ^
      |                 ;
   20 | }
      | ~
Language: C

#include<stdio.h>
#define LEN 1000000

typedef struct{
  char name[20];
  int time;
}que;

que Que[LEN];
int head=0, tail=0;

void enQue(que q){
  Que[head]=q;
  head++;
}

que deQue(void){
  tail++;
  return Que[tail-1];
}

int size(void){
  return head-tail;
}

int main(){
  int N, q;
  que Q;
  int i, j, k;
  int time=0;
  
  scanf("%d %d", &N, &q);
  for(i=0; i<N; i++){
    scanf("%s %d", Q.name, &Q.time);
    enQue(Q);
  }
  
  while(1){
    Q=deQue();
    if(Q.time<=q){
      time+=Q.time;
      printf("%s %d\n", Q.name, time);
    }
    else{
      Q.time-=q;
      times+=q;
      enQue(Q);
    }  
      if(size()==0) break;
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:46:7: error: 'times' undeclared (first use in this function); did you mean 'time'?
   46 |       times+=q;
      |       ^~~~~
      |       time
main.c:46: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 {
	char name[100];
	int t;
} P;

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

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

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

int main() {
	int elaps = 0;
	int cnt = 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);
	}

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

	return 0;
}

Compiler output:
main.c: In function 'dequeue':
main.c:21:1: error: stray '\343' in program
   21 | <U+3000><U+3000><U+3000><U+3000>if (head > LEN) {
      | ^~~~~~~~
main.c:21:3: error: stray '\343' in program
   21 | <U+3000><U+3000><U+3000><U+3000>if (head > LEN) {
      |         ^~~~~~~~
main.c:21:5: error: stray '\343' in program
   21 | <U+3000><U+3000><U+3000><U+3000>if (head > LEN) {
      |                 ^~~~~~~~
main.c:21:7: error: stray '\343' in program
   21 | <U+3000><U+3000><U+3000><U+3000>if (head > LEN) {
      |                         ^~~~~~~~