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

/* 
 * File:   main.c
 * Author: s1252007
 *
 * Created on June 24, 2018, 9:22 PM
 */

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

int main() 
{ 
    
    int count,j,n,time,remain,flag=0,time_quantum; 
    int wait_time=0,turnaround_time=0,*bt,*rt; 
    char **arr;
    scanf("%d %d", &n, &time_quantum); 
    
    arr = (char **)malloc(n+1 * sizeof(char *));
    for (int ix=0; ix<n+1; ix++)
         arr[ix] = (char *)malloc(2000 * sizeof(char));
    bt = (int *)malloc(sizeof(int) * n);
    rt = (int *)malloc(sizeof(int) * n);
    
    remain=n; 
    
    for(count=0;count<n;count++) 
    { 
        scanf("%s %d",arr[count], &bt[count]);
        rt[count]=bt[count]; 
    } 
    
    for(time=0,count=0;remain!=0;) 
    { 
        if(rt[count]<=time_quantum && rt[count]>0) 
        { 
            time+=rt[count]; 
            rt[count]=0; 
            flag=1; 
        } 
        else if(rt[count]>0) 
        { 
            rt[count]-=time_quantum; 
            time+=time_quantum; 
        } 
        if(rt[count]==0 && flag==1) 
        { 
            remain--; 
            printf("%s %d\n",arr[count],time); 
//          printf("P[%d]\t|\t%d\t|\t%d\n",count+1,time-at[count],time-at[count]-bt[count]); 
//            wait_time+=time-bt[count];
//            wait_time+=time-at[count]-bt[count];
//          turnaround_time+=time-at[count]; 
//            turnaround_time+=time; 
            flag=0; 
        } 
        if(count==n-1) 
            count=0; 
        else if(count+1<=time) 
            count++; 
        else 
            count=0; 
    } 

    return E0 
}



Compiler output:
main.c: In function 'main':
main.c:65:12: error: 'E0' undeclared (first use in this function)
   65 |     return E0
      |            ^~
main.c:65:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:65:14: error: expected ';' before '}' token
   65 |     return E0
      |              ^
      |              ;
   66 | }
      | ~
Language: C

/* 
 * File:   main.c
 * Author: s1252007
 *
 * Created on June 24, 2018, 9:22 PM
 */

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

int main() 
{ 
    
    int count,j,n,time,remain,flag=0,time_quantum; 
    int wait_time=0,turnaround_time=0,*bt,*rt; 
    char **arr;
    scanf("%d %d", &n, &time_quantum); 
    
    arr = (char **)malloc(n+1 * sizeof(char *));
    for (int ix=0; ix<n+1; ix++)
         arr[ix] = (char *)malloc(2000 * sizeof(char));
    bt = (int *)malloc(sizeof(int) * n);
    rt = (int *)malloc(sizeof(int) * n);
    
    remain=n; 
    
    for(count=0;count<n;count++) 
    { 
        scanf("%s %d",arr[count], &bt[count]);
        rt[count]=bt[count]; 
    } 
    
    for(time=0,count=0;remain!=0;) 
    { 
        if(rt[count]<=time_quantum && rt[count]>0) 
        { 
            time+=rt[count]; 
            rt[count]=0; 
            flag=1; 
        } 
        else if(rt[count]>0) 
        { 
            rt[count]-=time_quantum; 
            time+=time_quantum; 
        } 
        if(rt[count]==0 && flag==1) 
        { 
            remain--; 
            printf("%s %d\n",arr[count],time); 
//          printf("P[%d]\t|\t%d\t|\t%d\n",count+1,time-at[count],time-at[count]-bt[count]); 
//            wait_time+=time-bt[count];
//            wait_time+=time-at[count]-bt[count];
//          turnaround_time+=time-at[count]; 
//            turnaround_time+=time; 
            flag=0; 
        } 
        if(count==n-1) 
            count=0; 
        else if(count+1<=time) 
            count++; 
        else 
            count=0; 
    } 

    return 0
}


Compiler output:
main.c: In function 'main':
main.c:65:13: error: expected ';' before '}' token
   65 |     return 0
      |             ^
      |             ;
   66 | }
      | ~
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 main(){
  int elaps=0, c;
  int i, q;
  P u;

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


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

  while(head != tail)
  {
    u=dequeue();
    c=min(q, u.t);
    u.t-=c;
    elaps+=c;

    if(u.t > 0)
    enqueue(u);
    else
    {
    printf("%s %d\n", u.name, elaps);
    }
  }

  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:44:7: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   44 |     c=min(q, u.t);
      |       ^~~
      |       main
Language: C

#include<stdio.h>
char Bubblesort(char *,int);
char SelectionSort(char*,int);
int main(){
int n,i;
scanf("%d",&n);
if(n<1||n>36)return 0;
char *s[n];
for(i=0;i<n;i++){
  scanf("%s",s[i]);
}
for(i=0;i<n;i++){
printf("%s\n",Bubblesort(*s,n));
printf("%s\n",SelectionSort(*s,n));
s++;
}
return 0;
}

char Bubblesort(char *s,int n){
int i,j;
char a;
for(i=0;i<n;i++){
  for(j=n-1;j<i+1;j--){
      if(s[j]<s[j-1]){
  a=s[j];
  s[j]=s[j-1];
  s[j-1]=a;
    }
  }
}
return *s;
}

char SelectionSort(char *s,int n){
  int i,j;
  int min;
  char a;
  for(i=0;i<n;i++){
    min=i;
    for(j=i;j<n;j++){
      if(s[j]<s[min]){
        min=j;
      }
a=s[i];
s[i]=s[min];
s[min]=a;
    }
  }
return *s;
}



Compiler output:
main.c: In function 'main':
main.c:15:2: error: lvalue required as increment operand
   15 | s++;
      |  ^~
Language: C

#include<stdio.h>
#include<string.h>
#define L 100000

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

P p[LEN];
int h, t, n;

void enq(P x)
{
  p[t] = x;
  t = (t + 1) % L;
}

P deq()
{
  P x = p[h];
  h = (h + 1) % L;
  return x;
}

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

int main()
{
  int el = 0, c, i, q;
  P u;
  scanf("%d %d", &n, &q);
  for(i = 1; i <= n; i++)
    {
      scanf("%s", p[i].name);
      scanf("%d", &p[i].time);
    }
  h = 1; t = n + 1;

  while(h != t)
    {
      u = deq();
      c = min(q, u.time);
      u.time -= c;
      el += c;
      if(u.time > 0)
	{
	  enq(u);
	}
      else
	{
	  printf("%s %d\n", u.name, el);
	}
    }
  return 0;
}



Compiler output:
main.c:11:5: error: 'LEN' undeclared here (not in a function)
   11 | P p[LEN];
      |     ^~~
Language: C

#include<stdio.h>
#include<stdring.c.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;
  return x;
}

int main(int a,int b){returna<b ? a:b;}

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



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

#include<stdio.h>
#include<stdring.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;
  return x;
}

int main(int a,int b){returna<b ? a:b;}

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



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

#include<stdio.h>
#include<stdring.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;
  return x;
}

int main(int a,int b){returna<b ? a:b;}

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



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

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

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

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

void enqueue(P x){
  Q[tail]=x;
  tail=(tail+1)%LEN;
}
P dequeue(){
  P x=Q[head];
  head=(head+1)%LEN;
  return x;
}
int main(int a,int b){returna<b ? a:b;}

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



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

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

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

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

void enqueue(P x){
  Q[tail]=x;
  tail=(tail+1)%LEN;
}
P dequeue(){
  P x=Q[head];
  head=(head+1)%LEN;
  return x;
}
int main(int a,int b){return a<b ? a:b;}

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



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

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

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

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

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



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

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

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

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

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



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

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

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

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

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



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

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

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

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

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



Compiler output:
main.c:24:5: error: redefinition of 'main'
   24 | int main(){
      |     ^~~~
main.c:22:5: note: previous definition of 'main' with type 'int(int,  int)'
   22 | int main(int a,int b){return a<b ? a:b;}
      |     ^~~~
main.c: In function 'main':
main.c:24:1: error: number of arguments doesn't match prototype
   24 | int main(){
      | ^~~
main.c:22:5: error: prototype declaration
   22 | int main(int a,int b){return a<b ? a:b;}
      |     ^~~~
main.c:27:3: error: unknown type name 'p'
   27 |   p u;
      |   ^
main.c:36:7: error: implicit declaration of function 'depueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   36 |     u=depueue();
      |       ^~~~~~~
      |       dequeue
main.c:37:18: error: 't' undeclared (first use in this function)
   37 |       c=main(q,u,t);
      |                  ^
main.c:37:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:37:9: error: too many arguments to function 'main'
   37 |       c=main(q,u,t);
      |         ^~~~
main.c:24:5: note: declared here
   24 | int main(){
      |     ^~~~
main.c:38:8: error: request for member 't' in something not a structure or union
   38 |       u.t-=c;
      |        ^
main.c:40:11: error: request for member 't' in something not a structure or union
   40 |       if(u.t>0)enqueue(u);
      |           ^
main.c:40:24: error: incompatible type for argument 1 of 'enqueue'
   40 |       if(u.t>0)enqueue(u);
      |                        ^
      |                        |
      |                        int
main.c:13:16: note: expected 'P' {aka 'struct pp'} but argument is of type 'int'
   13 | void enqueue(P x){
      |              ~~^
main.c:41:30: error: request for member 'name' in something not a structure or union
   41 |       else{printf("%s,%d\n",u.name,elaps);
      |                              ^
main.c: At top level:
main.c:44:7: error: expected identifier or '(' before 'return'
   44 |       return p;}
      |       ^~~~~~
main.c:44:16: error: expected identifier or '(' before '}' token
   44 |       return p;}
      |                ^
Language: C

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

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

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

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



Compiler output:
main.c: In function 'main':
main.c:27:3: error: unknown type name 'p'
   27 |   p u;
      |   ^
main.c:36:7: error: implicit declaration of function 'depueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   36 |     u=depueue();
      |       ^~~~~~~
      |       dequeue
main.c:37:18: error: 't' undeclared (first use in this function)
   37 |       c=main(q,u,t);
      |                  ^
main.c:37:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:38:8: error: request for member 't' in something not a structure or union
   38 |       u.t-=c;
      |        ^
main.c:40:11: error: request for member 't' in something not a structure or union
   40 |       if(u.t>0)enqueue(u);
      |           ^
main.c:40:24: error: incompatible type for argument 1 of 'enqueue'
   40 |       if(u.t>0)enqueue(u);
      |                        ^
      |                        |
      |                        int
main.c:13:16: note: expected 'P' {aka 'struct pp'} but argument is of type 'int'
   13 | void enqueue(P x){
      |              ~~^
main.c:41:30: error: request for member 'name' in something not a structure or union
   41 |       else{printf("%s,%d\n",u.name,elaps);
      |                              ^
main.c: At top level:
main.c:44:7: error: expected identifier or '(' before 'return'
   44 |       return p;}
      |       ^~~~~~
main.c:44:16: error: expected identifier or '(' before '}' token
   44 |       return p;}
      |                ^
Language: C

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

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

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

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



Compiler output:
main.c: In function 'main':
main.c:36:7: error: implicit declaration of function 'depueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   36 |     u=depueue();
      |       ^~~~~~~
      |       dequeue
main.c:36:7: error: incompatible types when assigning to type 'P' {aka 'struct pp'} from type 'int'
main.c:37:18: error: 't' undeclared (first use in this function)
   37 |       c=main(q,u,t);
      |                  ^
main.c:37:18: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:44:7: error: expected identifier or '(' before 'return'
   44 |       return p;}
      |       ^~~~~~
main.c:44:16: error: expected identifier or '(' before '}' token
   44 |       return p;}
      |                ^
Language: C

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

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

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

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



Compiler output:
main.c: In function 'main':
main.c:37:7: error: implicit declaration of function 'depueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   37 |     u=depueue();
      |       ^~~~~~~
      |       dequeue
main.c:37:7: error: incompatible types when assigning to type 'P' {aka 'struct pp'} from type 'int'
main.c:38:18: error: 't' undeclared (first use in this function)
   38 |       c=main(q,u,t);
      |                  ^
main.c:38:18: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:45:7: error: expected identifier or '(' before 'return'
   45 |       return p;}
      |       ^~~~~~
main.c:45:16: error: expected identifier or '(' before '}' token
   45 |       return p;}
      |                ^
Language: C

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

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

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

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



Compiler output:
main.c: In function 'main':
main.c:37:7: error: implicit declaration of function 'depueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   37 |     u=depueue();
      |       ^~~~~~~
      |       dequeue
main.c:37:7: error: incompatible types when assigning to type 'P' {aka 'struct PP'} from type 'int'
main.c:38:18: error: 't' undeclared (first use in this function)
   38 |       c=main(q,u,t);
      |                  ^
main.c:38:18: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:45:7: error: expected identifier or '(' before 'return'
   45 |       return p;}
      |       ^~~~~~
main.c:45:16: error: expected identifier or '(' before '}' token
   45 |       return p;}
      |                ^
Language: C

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

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

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

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



Compiler output:
main.c: In function 'main':
main.c:37:7: error: implicit declaration of function 'depueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   37 |     u=depueue();
      |       ^~~~~~~
      |       dequeue
main.c:37:7: error: incompatible types when assigning to type 'P' {aka 'struct PP'} from type 'int'
main.c:38:18: error: 't' undeclared (first use in this function)
   38 |       c=main(q,u,t);
      |                  ^
main.c:38:18: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:45:7: error: expected identifier or '(' before 'return'
   45 |       return P;}
      |       ^~~~~~
main.c:45:16: error: expected identifier or '(' before '}' token
   45 |       return P;}
      |                ^
Language: C

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

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

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

void enqueue(P x){
  Q[tail]=x;
  tail=(tail+1)%LEN;
}
P dequeue(){
  P x=Q[head];
  head=(head+1)%LEN;
  return x;
}
int man(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=depueue();
      c=main(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:37:7: error: implicit declaration of function 'depueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   37 |     u=depueue();
      |       ^~~~~~~
      |       dequeue
main.c:37:7: error: incompatible types when assigning to type 'P' {aka 'struct PP'} from type 'int'
main.c:38:18: error: 't' undeclared (first use in this function)
   38 |       c=main(q,u,t);
      |                  ^
main.c:38:18: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:45:7: error: expected identifier or '(' before 'return'
   45 |       return 0;
      |       ^~~~~~
main.c:46:7: error: expected identifier or '(' before '}' token
   46 |       }
      |       ^
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 man(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=depueue();
      c=main(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:37:7: error: implicit declaration of function 'depueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   37 |     u=depueue();
      |       ^~~~~~~
      |       dequeue
main.c:37:7: error: incompatible types when assigning to type 'P' {aka 'struct PP'} from type 'int'
main.c:38:18: error: 't' undeclared (first use in this function)
   38 |       c=main(q,u,t);
      |                  ^
main.c:38:18: 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 time;
}P;

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

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

}

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

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

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

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

  }

  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:38:21: error: 'P' {aka 'struct pp'} has no member named 't'
   38 |     scanf("%d",&Q[i].t);
      |                     ^
main.c:45:14: error: 'P' {aka 'struct pp'} has no member named 't'
   45 |     c=min(q,u.t);
      |              ^
main.c:46:6: error: 'P' {aka 'struct pp'} has no member named 't'
   46 |     u.t -= c;
      |      ^
main.c:48:9: error: 'P' {aka 'struct pp'} has no member named 't'
   48 |     if(u.t>0) enqueue(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 man(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=main(q,u,t);
      u.t-=c;
      elaps+=c;
      if(u.t>0)enqueue(u);
      else{printf("%s,%d\n",u.name,elaps);
      }
      }
      return 0;
      }



Compiler output:
main.c: In function 'main':
main.c:38:18: error: 't' undeclared (first use in this function)
   38 |       c=main(q,u,t);
      |                  ^
main.c:38:18: 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];
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 man(int a,int b){return a<b ? a:b;}

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

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



Compiler output:
main.c: In function 'main':
main.c:38:9: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   38 |       c=min(q,u,t);
      |         ^~~
      |         main
main.c:38:17: error: 't' undeclared (first use in this function)
   38 |       c=min(q,u,t);
      |                 ^
main.c:38:17: 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];
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 man(int a,int b){return a<b ? a:b;}

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

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



Compiler output:
main.c: In function 'main':
main.c:38:9: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   38 |       c=min(q,u.t);
      |         ^~~
      |         main
Language: C

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


typedef struct
{
   char name[500];
   int time;   
}Process;
    

int enqueue( Process *p, Process x,int tail,int number);
int dequeue( Process *p, Process x, int head,int number);

int main() {
    int head = 0;
    int tail = 0;
    int number, time;
    
    int readScan = scanf("%d %d", &number, &time);
    Process p[number];
     p = (char *)malloc(100 * sizeof(char));
    for(int i=0; i<number; i++)
    {
        int readScan = scanf("%s %d", &p[i].name, &p[i].time);
    }  
    tail = number;

        int toltime = 0;
        do{   
        if(time == 1)
        {
            printf("%s %d\n",p[head].name,p[head].time);
            head = dequeue( p, p[head],head,number);
        }
        if (p[head].time <= time)
        {
            toltime = toltime + p[head].time;
            printf("%s %d\n",p[head].name, toltime);
            head = dequeue(p ,p[head],head,number);
        }
        if(p[head].time > time)
        {
            toltime = toltime + time;
            p[head].time = p[head].time - time;
            tail = enqueue( p, p[head],tail,number);
            head = dequeue( p, p[head],head,number);
        }
    }while(head != tail);

return 0;
}


int enqueue( Process* p, Process x,int tail,int number)
{
  
   p[tail].time = x.time;
   strcpy(p[tail].name, x.name);
   if(tail + 1 == number)
      tail = 0;
   else
       tail = tail+1;
   return tail;
}

int dequeue( Process* p, Process x, int head,int number)
{
    
    strcpy(x.name, p[head].name);
    x.time = p[head].time;
    if(head +1 == number)
        head = 0;
    else 
        head = head + 1;
    return head;
}






Compiler output:
main.c: In function 'main':
main.c:23:8: error: assignment to expression with array type
   23 |      p = (char *)malloc(100 * sizeof(char));
      |        ^
Language: C

#include<stdio.h>
#define L 100005

typedef struct{
  char pname[100];
  int time;
}EQ;

EQ eq[L];
int head, tail,n;

void enqueue(EQ a){
  eq[tail]=a;
  tail=(tail+1)%L;
}

EQ dequeue(){
  EQ a=eq[head];
  head=(head+1)%L;
  return 0;
}

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

int main(){

  int sumtime=0,add;
  int i,q;
  P ch;
  scanf("%d %d",&n,&q);
  for(i=1;i<=n;i++){
    scanf("%s%d",eq[i].name,&eq[i].time);
  }
  head=1;
  tail=n+1;

  while(head!=tail){
    ch=dequeue();
    add=min(q,ch.time);
    ch.time-=add;
    sumtime+=add;
    if(ch.time>0)enqueue(ch);
    else{printf("%s %d\n",ch.pname,sumtime);}
  }
  return 0;
}




  
}



Compiler output:
main.c: In function 'dequeue':
main.c:20:10: error: incompatible types when returning type 'int' but 'EQ' was expected
   20 |   return 0;
      |          ^
main.c: In function 'minjudge':
main.c:25:16: error: expected ';' before '}' token
   25 |   else{return b}
      |                ^
      |                ;
main.c: In function 'main':
main.c:32:3: error: unknown type name 'P'
   32 |   P ch;
      |   ^
main.c:35:24: error: 'EQ' has no member named 'name'; did you mean 'pname'?
   35 |     scanf("%s%d",eq[i].name,&eq[i].time);
      |                        ^~~~
      |                        pname
main.c:41:8: error: incompatible types when assigning to type 'int' from type 'EQ'
   41 |     ch=dequeue();
      |        ^~~~~~~
main.c:42:9: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   42 |     add=min(q,ch.time);
      |         ^~~
      |         main
main.c:42:17: error: request for member 'time' in something not a structure or union
   42 |     add=min(q,ch.time);
      |                 ^
main.c:43:7: error: request for member 'time' in something not a structure or union
   43 |     ch.time-=add;
      |       ^
main.c:45:10: error: request for member 'time' in something not a structure or union
   45 |     if(ch.time>0)enqueue(ch);
      |          ^
main.c:45:26: error: incompatible type for argument 1 of 'enqueue'
   45 |     if(ch.time>0)enqueue(ch);
      |                          ^~
      |                          |
      |                          int
main.c:12:17: note: expected 'EQ' but argument is of type 'int'
   12 | void enqueue(EQ a){
      |              ~~~^
main.c:46:29: error: request for member 'pname' in something not a structure or union
   46 |     else{printf("%s %d\n",ch.pname,sumtime);}
      |                             ^
main.c: At top level:
main.c:55:1: error: expected identifier or '(' before '}' token
   55 | }
      | ^
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)%LEN

}

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


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

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

  head = 1;
  tail = n+1;

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



Compiler output:
main.c: In function 'enqueue':
main.c:17:1: error: expected ';' before '}' token
   17 | }
      | ^
main.c: In function 'main':
main.c:42:8: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   42 |     c= min(q,u,t);
      |        ^~~
      |        main
main.c:42:16: error: 't' undeclared (first use in this function)
   42 |     c= min(q,u,t);
      |                ^
main.c:42:16: 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;

int res(int x, int y){
  return x<y?x:y;
}
void enqueue(P x){
  Q[tail]=x;
  tail = (tail+1)%LEN

}

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


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

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

  head = 1;
  tail = n+1;

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



Compiler output:
main.c: In function 'enqueue':
main.c:20:1: error: expected ';' before '}' token
   20 | }
      | ^
main.c: In function 'main':
main.c:45:16: error: 't' undeclared (first use in this function)
   45 |     c= res(q,u,t);
      |                ^
main.c:45:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:45:14: error: incompatible type for argument 2 of 'res'
   45 |     c= res(q,u,t);
      |              ^
      |              |
      |              P {aka struct pp}
main.c:13:20: note: expected 'int' but argument is of type 'P' {aka 'struct pp'}
   13 | int res(int x, int y){
      |                ~~~~^
main.c:45:8: error: too many arguments to function 'res'
   45 |     c= res(q,u,t);
      |        ^~~
main.c:13:5: note: declared here
   13 | int res(int x, int y){
      |     ^~~
Language: C

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

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

int main(){
  int i,n,q,sum=0,x;
  string s;
  P A[1000];
  queue<string> Name;
  queue<int> Time;

  cin >> n >> q;

  for(i=0;i<n;i++){
    cin >> A[i].name >> A[i].t;
    Name.push(A[i].name);
    Time.push(A[i].t);
  }
  while(Name.empty()==0){
    s=Name.front();
    x=Time.front();
    if(x<=q){
      sum+=x;
      cout << s << " " << sum <<endl;
    }
    else{
      sum+=q;
      x-=q;
      Name.push(s);
      Time.push(x);
    }
    Name.pop();
    Time.pop();
  }
  return 0;
}


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

#include <stdio.h>
#include <string.h>
#include<stdlib.h>
#define n_max 100005
#define len 100

typedef struct task{
  char name[len];
  int time;
}T;

int main(){
  int fin=0,i,q,n,count=0;
  T Q[n_max];

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

  i=1;
  count=n;

  while(1){
    if(Q[i].time<=q){
      count--;
      fin+=Q[i].time;
      printf("%s %d\n",Q[i].name,fin);
      if(count==0)break;
    }
    else{
      fin+=q;
      Q[i].time-=q;
      Q[i+count].time=Q[i].time;
      strcpy(Q[i+count].name,Q[i].name);
    }
    i++;
  }
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:17:8: error: 'N' undeclared (first use in this function)
   17 |   if(n>N||n<=0) exit(1);
      |        ^
main.c:17:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdlib.h>
#define LEN 100005
#define MAX 100000

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

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

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

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

int isEmpty(){
  return head == tail;
}

int isFull(){
  return head == (tail + 1)%MAX;
}

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

  for ( i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }
  head = 1;
  tail = n + 1;
  while(head != tail){
    u = dequeue();
    c = min(q,u.t);
    u.t -= c;
    elaps += c;
    if(u.t > 0)enqueue(u);
    else{
      printf("%s %d\n",u.name,elaps);
    }
  }
  return 0;
}



Compiler output:
main.c: In function 'enqueue':
main.c:15:6: error: implicit declaration of function 'isFull' [-Wimplicit-function-declaration]
   15 |   if(isFull()){
      |      ^~~~~~
main.c: In function 'dequeue':
main.c:26:6: error: implicit declaration of function 'isEmpty' [-Wimplicit-function-declaration]
   26 |   if(isEmpty()){
      |      ^~~~~~~
main.c: In function 'main':
main.c:58:9: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   58 |     c = min(q,u.t);
      |         ^~~
      |         main
Language: C

#include<stdio.h>
#include<string.h>
void QueSort(char (*A)[11],int *,int,int);
int main(){
  int  n,q;
  char A[100000][11];
  int  B[100000];
  int  i;
  scanf("%d%d",&n,&q);
  for(i=0;i<n;i++){
    scanf("%s%d",&A[i],&B[i]);
  }
  QueSort(A,B,n,q);
  return 0;
}
void QueSort(char (*A)[11],int *B,int n,int q){
  int  s=0,t=0 i;
  
  while(t!=n){
    for(i=0;i<n-1;i++){
      if(B[i]!=0){
	if(d <= q){
	  s+=d;
	  t++;
	  printf("%s %d\n",A[i],s);
	  B[i]=0;
	}
	else{
	  s+=q;
	  B[i]=d-q;
	}
      }
    }
  }
}



Compiler output:
main.c: In function 'QueSort':
main.c:17:16: error: expected ',' or ';' before 'i'
   17 |   int  s=0,t=0 i;
      |                ^
main.c:20:9: error: 'i' undeclared (first use in this function)
   20 |     for(i=0;i<n-1;i++){
      |         ^
main.c:20:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:12: error: 'd' undeclared (first use in this function)
   22 |         if(d <= q){
      |            ^
Language: C

#include<stdio.h>
#include<string.h>
#define MAX 1000005
 typedef struct  d{
  char name[11];
  int time;
  char sname[11];
  int stime;
  char Ansname[11];
  int Anstime;
}date;

 
Int main(){
  int n,q,i,str,tmp,tmp2,j,k=0;
  date tn[MAX];

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

  for(i=1;i<n+1;i++){
    scanf("%s ",tn[i].name);
     scanf("%d",&tn[i].time);
  }
  tmp2=n+1;
  i=1;
  while(1){
   
    tn[i].stime=(tn[i].time-q);
    if(tn[i].stime>0){
       
     
      tn[tmp2].time=tn[i].stime;
      strcpy(tn[i].sname,tn[i].name);
      strcpy(tn[tmp2].name,tn[i].sname);
      str+=q;
      if(tmp2==n+1){
	tmp2=1;
      }
      else{
	tmp2++;
      }
      if(i==n+1){
	i=1;
      }
      else{
	i++;
      }
      
    }
    else{
     
      str+=tn[i].time;
      tn[k].Anstime=str;
      tn[i].time=0;
      strcpy(tn[k].Ansname,tn[i].name);
      k++;
      strcpy ( tn[i].name," ");
      if(i==n+1){
	i=1;
      }
      else{
	i++;
      }
    }
    if(k==n){
      break;
    }

  }
  for(j=0;j<n;j++){
    printf("%s %d\n",tn[j].Ansname,tn[j].Anstime);
  }
  return 0;
}



Compiler output:
main.c:14:1: error: unknown type name 'Int'; did you mean 'int'?
   14 | Int main(){
      | ^~~
      | int
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 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 'main':
main.c:26:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   26 |   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:26:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   26 |   scanf("%d %d", &n, &q);
      |   ^~~~~
main.c:26:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
Language: C

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

int main(){

  int n, q, *time, i, tsam=0, cnt=0,j;
  char *name[t];

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

  time = (int *)malloc(sizeof(int)*n);
  for(i=0; i<=n-1; i++){
    name[i] = (char *)malloc(sizeof(char)*n);
  }
  for(i=0; i<=n-1; i++){
    scanf("%s%d",name[i], &time[i]);
  }

  while(cnt != n){
    for(i=0; i<=n-1; i++){
      if(time[i] <=q && time[i] > 0){
        tsam += time[i];
        time[i] = 0;
        printf("%s %d\n",name[i], tsam);
        cnt++;
      }
      else if(time[i] > q){
        time[i] = time[i] - q;
        tsam += q;
      }
    }
    }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:14: error: 't' undeclared (first use in this function)
    7 |   char *name[t];
      |              ^
main.c:7:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

import java.util.*;
import java.io.*;

class queue{
    public static void main(String[] args) throws IOE{
	Scanner s=new Scanner(System.in);
	int i,n,m,gt=0;

	Queue<string>q=newLinkedList<String>();
	Queue<Integer>time=new LinkedList<Integer>();

	n=s.nextInt();
	t=s.nextInt();

	for(i=0;i<n;i++){
	    q.add(s.next());
	    time.add(s.nextInt());
	}

	while(0<p.size()){
	    if(0<(time.peek()-m)){
		p.add(q.poll());
		time.add(time.poll()-m);
		gt=ge+m;
	    }
	    else{
		gt=gt+time.poll();
		System.out.println(q.poll()+""+gt);
	    }
	}



Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.*;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.*;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.io.*;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.io.*;
      |            ^
main.c:4:1: error: unknown type name 'class'
    4 | class queue{
      | ^~~~~
main.c:4:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    4 | class queue{
      |            ^
Language: C


#include <stdio.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();


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


  return 0;
}


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

#include <stdio.h>
#include <string.h>
typedef struct proces {
  char name[10];
  int t;
  int flag;
} P;

P S[100005];
int head, tail, n;

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

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

int min(int a, int b) {
  if (x > y)
    return y;
  else
    return x;
}
int main() {
  int spend = 0, c, i, qp;
  P in;

  scanf("%d %d", &n, &qp);
  for (i = 1; i <= n; i++) {
    scanf("%s", S[i].name);
    scanf("%d", &S[i].t);
    S[i].flag = 1;
  }
  head = 1;
  tail = n + 1;
  while (head != tail) {
    in = dequeue();
    c = min(qp, in.t);
    in.t -= c;
    spend += c;
    if (in.t > 0) {
      enqueue(in);
    } else if (in.flag == 1) {
      printf("%s %d\n", in.name, spend);
      in.flag = 0;
    }
  }
  return 0;
}



Compiler output:
main.c: In function 'min':
main.c:24:7: error: 'x' undeclared (first use in this function)
   24 |   if (x > y)
      |       ^
main.c:24:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:24:11: error: 'y' undeclared (first use in this function)
   24 |   if (x > y)
      |           ^