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

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

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

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

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

typedef struct{

  char n[10];
  int t;

}P;
 
void enqueue(P);
P dequeue(void);
int min(int a,int b){
  if(a >= b)
    return b;
  else return a;
}
int head,tail,n;
P Q[100000];
 
int main(){
  int q, i, total = 0, c;
  P u;
 
  scanf("%d%d", &n, &q);
  for( i = 0; i < n; i++)
    scanf("%s%d", Q[i].n, &Q[i].t);
 
  head = 0;
  tail = n;
 
  while( head != tail){
    u = dequeue();
    c = min( q, u.t);
    u.time -= c;
    total += c;
    if( u.t > 0)
      enqueue( u);
    else
      printf("%s %d\n", u.n, total);
  }
  return 0;
}
 
void enqueue(P x){
  Q[tail] = x;
  if(tail == n)
    tail = 0;
  else
    tail++;
}
 
P dequeue(void){
  P x;
  x = Q[head];
 
  if(head == n)
    head = 0;
  else
    head++;
  return x;
}
 

Compiler output:
main.c: In function 'main':
main.c:35:6: error: 'P' has no member named 'time'
   35 |     u.time -= c;
      |      ^
Language: C

//============================================================================
// 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>

//============================================================================
typedef struct{
    char name[20];
    long quantam;
    int  order;
}TSchdule;
//============================================================================
int Quantam;
//============================================================================
void dump(int *A, int N)
{
    int i;

    for (i=0; i<N; i++){
        if (i)
            printf(" ");
        printf("%d", A[i]);
    }
    printf("\n");
}
//============================================================================
void cdump(char *str)
{
    int i;

    printf("%d:", strlen(str));;
    for (i=0; i<strlen(str); i++){
        if (i)
            printf(" ");
        printf("%02X", (unsigned char)str[i]);
    }
    printf("\n");
}
//============================================================================
int remain(TSchdule *sch, int n)
{
    long i;

    for (i=0; i<n; i++)
        if (sch[i].quantam)
            return 1
    //printf("r%ld\n", r);
    return 0;
}
//============================================================================
int Spend(long width, long req)
{
    if (req<width)
        return req;
    return width;
}
//============================================================================
void process(TSchdule *sch, int n)
{
    long i,tm; int spend;

    tm=0;
    while(remain(sch,n)){
        for (i=0; i<n; i++){
            if (sch[i].quantam){
                spend=Spend(Quantam, sch[i].quantam);
                sch[i].quantam-=spend;
                tm+=spend;
                //printf("%ld tm:%ld, sp:%d, ", i, tm, spend);
                if (!sch[i].quantam)
                    printf("%s %ld\n", sch[i].name, tm);
            }
        }
    }
}
//============================================================================
void input()
{
    long i,n; TSchdule *sch;

    scanf("%ld", &n);
    scanf("%d%*c", &Quantam);
    //printf("n=%ld, Quantam=%d\n", n, Quantam);
    sch=malloc(n*sizeof(TSchdule));
    for (i=0; i<n; i++){
        //scanf("%*s");
        scanf("%s", sch[i].name);
        scanf("%ld%*c", &sch[i].quantam);
        sch[i].order=i;
        
    }
    //for (i=0; i<n; i++)
    //    printf("%s %ld\n", sch[i].name, sch[i].quantam);
    process(sch, n);
    free(sch);
}
//============================================================================
int main(void)
{
    input();
    return 0;
}
//============================================================================

Compiler output:
main.c: In function 'remain':
main.c:49:21: error: expected ';' before 'return'
   49 |             return 1
      |                     ^
      |                     ;
   50 |     //printf("r%ld\n", r);
   51 |     return 0;
      |     ~~~~~~
Language: C

#include <cstdio>
#include <queue>
#include <string>
#include <utility>
 
using namespace std;
 
int main() {
    size_t n;
    int qtime;
    scanf("%zu %d", &n, &qtime);
 
    queue<pair<string, int>> q;
    for (size_t i=0; i<n; ++i) {
        char buf[1<<4];
        int time;
        scanf("%s %d", buf, &time);
        string name(buf);
        q.push(make_pair(name, time));
    }
 
    for (int t=0; !q.empty();) {
        pair<string, int> p=q.front(); q.pop();
        if (p.second > qtime) {
            p.second -= qtime;
            t += qtime;
            q.push(p);
        } else {
            t += p.second;
            printf("%s %d\n", p.first.c_str(), t);
        }
    }
    return 0;
}

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

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>
#define N 10000

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

int head, tail, n;
struct Queue Q[N];

void initialize();
void enqueue(Queue);
struct Queue dequeue();

int main() {
	struct Queue a;
	int q, i, t=0, cnt = 0;
	scanf("%d%d", &n, &q);
	initialize();
	for (i = 0; i < n; i++) scanf("%s %d", Q[i].name, &Q[i].time);
	while (cnt != n) {
		a = dequeue();
		if (a.time <= q) {
			t += a.time;
			printf("%s %d\n", a.name, t);
			++cnt;
		}
		else {
			t += q;
			a.time -= q;
			enqueue(a);
		}
	}
	return 0;
}

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

void enqueue(Queue a) {
	Q[tail] = a;
	if (tail + 1 == n) tail = 0;
	else ++tail;
}

Queue dequeue() {
	struct Queue a;
	a = Q[head];
	if (head + 1 == n) head = 0;
	else ++head;
	return a;
}

Compiler output:
main.c:9:1: warning: useless storage class specifier in empty declaration
    9 | };
      | ^
main.c:15:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
   15 | void enqueue(Queue);
      | ^~~~
main.c:44:14: error: unknown type name 'Queue'
   44 | void enqueue(Queue a) {
      |              ^~~~~
main.c:50:1: error: unknown type name 'Queue'; use 'struct' keyword to refer to the type
   50 | Queue dequeue() {
      | ^~~~~
      | struct 
main.c:50:7: error: conflicting types for 'dequeue'; have 'int()'
   50 | Queue dequeue() {
      |       ^~~~~~~
main.c:16:14: note: previous declaration of 'dequeue' with type 'struct Queue()'
   16 | struct Queue dequeue();
      |              ^~~~~~~
main.c: In function 'dequeue':
main.c:55:16: error: incompatible types when returning type 'struct Queue' but 'int' was expected
   55 |         return a;
      |                ^
Language: C

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>
#define N 10000

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

int head, tail, n;
struct Queue Q[N];

void initialize();
void enqueue(Queue);
struct Queue dequeue();

int main() {
	struct Queue a;
	int q, i, t=0, cnt = 0;
	scanf("%d%d", &n, &q);
	initialize();
	for (i = 0; i < n; i++) scanf("%s %d", Q[i].name, &Q[i].time);
	while (cnt != n) {
		a = dequeue();
		if (a.time <= q) {
			t += a.time;
			printf("%s %d\n", a.name, t);
			++cnt;
		}
		else {
			t += q;
			a.time -= q;
			enqueue(a);
		}
	}
	return 0;
}

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

void enqueue(Queue a) {
	Q[tail] = a;
	if (tail + 1 == n) tail = 0;
	else ++tail;
}

struct Queue dequeue() {
	struct Queue a;
	a = Q[head];
	if (head + 1 == n) head = 0;
	else ++head;
	return a;
}

Compiler output:
main.c:15:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
   15 | void enqueue(Queue);
      | ^~~~
main.c:44:14: error: unknown type name 'Queue'
   44 | void enqueue(Queue a) {
      |              ^~~~~
Language: C

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>

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

int head = 0, tail = 0, n;
struct Queue Q[1000];

void enqueue(Queue);
struct Queue dequeue();

int main() {
	struct Queue a;
	int q, i, t = 0, cnt = 0;
	scanf("%d%d", &n, &q);
	for (i = 0; i < n; i++) scanf("%s %d", Q[i].name, &Q[i].time);
	while (cnt != n) {
		a = dequeue();
		if (a.time <= q) {
			t += a.time;
			printf("%s %d\n", a.name, t);
			++cnt;
		}
		else {
			t += q;
			a.time -= q;
			enqueue(a);
		}
	}
	return 0;
}

void enqueue(Queue a) {
	Q[tail] = a;
	if (tail + 1 == n) tail = 0;
	else ++tail;
}

struct Queue dequeue() {
	struct Queue a;
	a = Q[head];
	if (head + 1 == n) head = 0;
	else ++head;
	return a;
}

Compiler output:
main.c:13:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
   13 | void enqueue(Queue);
      | ^~~~
main.c:37:14: error: unknown type name 'Queue'
   37 | void enqueue(Queue a) {
      |              ^~~~~
Language: C

#include<stdio.h>
#include<string.h>
#define N 100000
????
typedef struct pp{
????char name[100];
????int time;
}Process;
??
????
int head, tail, n, c=0, q;
Process Q[N];
??
??
void enqueue(){
????Q[head].time = Q[head].time -q;
????Q[tail] = Q[head];
????if(tail > n+1) tail = 0;
????else tail++;
}
????
void dequeue(){
????printf("%s %d\n",Q[head].name, Q[head].time+c);
}
????
int main(){
????int i;
????????
????scanf("%d %d", &n, &q);
????for ( i = 1; i <= n; i++){
????????scanf("%s", Q[i].name);
????????scanf("%d", &Q[i].time);
????}
????head = 1;
????tail = n+1;
????i = 1;
????while(head != tail){
????????if(Q[head].time > q){
????????enqueue();
????????c = c + q;
????????}
????????else{
????????????dequeue();
????????????c = c + Q[head].time;
????????}
????if(head > n+1) head = 0;
????else head++;
????}
????return 0;
}

Compiler output:
main.c:4:1: error: expected identifier or '(' before '?' token
    4 | ????
      | ^
main.c:8:2: warning: data definition has no type or storage class
    8 | }Process;
      |  ^~~~~~~
main.c:8:2: error: type defaults to 'int' in declaration of 'Process' [-Wimplicit-int]
main.c:9:1: error: expected identifier or '(' before '?' token
    9 | ??
      | ^
main.c:12:1: error: unknown type name 'Process'
   12 | Process Q[N];
      | ^~~~~~~
main.c:13:1: error: expected identifier or '(' before '?' token
   13 | ??
      | ^
main.c:21:1: error: expected identifier or '(' before '?' token
   21 | ????
      | ^
main.c:25:1: error: expected identifier or '(' before '?' token
   25 | ????
      | ^
Language: C

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

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

int head, tail, n, c=0, q;
Process Q[N];

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

Compiler output:
main.c:19:1: error: expected identifier or '(' before '?' token
   19 | ????
      | ^
main.c:23:1: error: expected identifier or '(' before '?' token
   23 | ????
      | ^
Language: C

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

typedef struct pp{
	char name[100];
	int time;
	int time2;
}Process;

int head, tail, n, c=0, q;
Process Q[N];

void enqueue(){
	Q[head].time = Q[head].time -q;
	Q[tail] = Q[head];
	if(tail > n+1) tail = 0;
	else tail++;
	for ( i = 1; i <= tail; i++){
		prnitf("%s", Q[i].name);
		printf("%d", Q[i].time);
	}
}

void dequeue(){
	printf("%s %d\n",Q[head].name, Q[head].time+c);
}

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

Compiler output:
main.c: In function 'enqueue':
main.c:19:15: error: 'i' undeclared (first use in this function)
   19 |         for ( i = 1; i <= tail; i++){
      |               ^
main.c:19:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:17: error: implicit declaration of function 'prnitf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   20 |                 prnitf("%s", Q[i].name);
      |                 ^~~~~~
      |                 printf
Language: C

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

typedef struct pp{
	char name[100];
	int time;
	int time2;
}Process;

int head, tail, n, c=0, q;
Process Q[N];

void enqueue(){
	int i;
	Q[head].time = Q[head].time -q;
	Q[tail] = Q[head];
	if(tail > n+1) tail = 0;
	else tail++;
	for ( i = 1; i <= tail; i++){
		prnitf("%s", Q[i].name);
		printf("%d", Q[i].time);
	}
}

void dequeue(){
	printf("%s %d\n",Q[head].name, Q[head].time+c);
}

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

Compiler output:
main.c: In function 'enqueue':
main.c:21:17: error: implicit declaration of function 'prnitf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   21 |                 prnitf("%s", Q[i].name);
      |                 ^~~~~~
      |                 printf
Language: C

#include<stdio.h>
#include<cstring>
//int LEN=100005;
const int LEN=100005;
 struct pp{
    char name[100];
    int t;
};
struct myqueue{
    pp a[LEN];
    int head,tail;
    bool isfull(){
      if((tail+1)%LEN==head) return 1;
      return 0;
    }
    bool isempty(){
      if(head==tail)return 1;
      return 0;
    }
    void push(pp x){
        if(!isfull()){
        a[tail%LEN]=x;
        tail++;
    }
    }
    pp pop(){
     if(!isempty()){
        pp m=a[head%LEN];
        head++;
        return m;
     }

    }
} q;
int main( ){
    //myqueue q;
    int m,n;
    pp p;
    scanf("%d%d",&m,&n);
    for(int i=0;i<m;i++){
        scanf("%s%d",p.name,&p.t);
        q.push(p);
    }
    int hm=0;
    while(!q.isempty()){
        pp p1;
        p1=q.pop();
        if(p1.t<=n){
            hm=hm+p1.t;
         printf("%s %d\n",p1.name,hm);
        }else{
         hm=hm+n;
         p1.t-=n;
         q.push(p1);
        }
    }

  return 0;
}

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

#include<stdio.h>
#include<queue>
using namespace std;
typedef struct hh{
    char name[15];
    int t;
}p;
p q[100005];
int h,t,n;
void en(p x){
    q[t]=x;
    t=(t+1)%100005;
}
p de(){
    p x=q[h];
    h=(h+1)%100005;
    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);
    }
    h=1;
    t=n+1;
    while(h!=t){
        u=de();
        c=min(Q,u.t);
        u.t-=c;
        elaps+=c;
        if(u.t>0)
            en(u);
        else{
            printf("%s %d\n",u.name,elaps);
        }
    }
    return 0;
}

Compiler output:
main.c:2:9: fatal error: queue: No such file or directory
    2 | #include<queue>
      |         ^~~~~~~
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;

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 i, q, n, LANtime = 0;
	P u;

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

	head = 0; tail = n;

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

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:29:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   29 |         scanf_s("%d %d", &n, &q);
      |         ^~~~~~~
      |         scanf
Language: C

#include <iostream>
using namespace std;
const int LEN = 100000;//??????????????§??????
struct pp
{
	char name[10];
	int time;
} P[LEN];
int head, tail, n;
void enqueue(struct pp x)//??\????????°
{
	P[tail] = x;//?°?x?????\??°????°?
	tail = tail + 1;//??¨?????????????????????????????????head=(tail + 1) % LEN??¶??´???????????????
}
struct pp dequeue()//???????????°
{
	struct pp x = P[head];//?°?head??????????????´????´?????????\??????x
	head = head + 1;
	return x;//????????????????´?
}
int min(int a, int b)//??????a???b?????´????°???????
{
	return a < b ? a : b;
}
int main()
{
	int alltime=0;//?´??????¶??´  ?±???¨????????????????§????
	int n, q;//n??¨???????????°???q??¨?????¶??´????????§?°?
	struct pp u;
	cin >> n >> q;
	//?°?????????????????????°?????????
	for (int i = 0; i < n; i++)
	{
		scanf("%s%d",& P[i].name,& P[i].time);//cin >> P[i].name >> P[i].time;
	}
	head = 0; tail = n;
	//?¨??????¶??´????????¬???
	while (head != tail)
	{
		u = dequeue();//?????´????´???????
		int c = min(q, u.time);//????????¶??´????????§?°??????\????????????????????¶??´
		u.time = u.time - q;//????????????????????????????????¶??´
		alltime = alltime + c;
		if (u.time > 0)
			enqueue(u);//??????????????¬????????\??°????°?
		else
		{
			printf("%s %d\n",u.name,alltime);//cout << u.name << " " << alltime << endl;
		}
	}
	return 0;
}

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


#include<stdio.h>
using namespace std;
const int LEN = 100000;//??????????????§??????
struct pp
{
	char name[10];
	int time;
} P[LEN];
int head, tail, n;
void enqueue(struct pp x)//??\????????°
{
	P[tail] = x;//?°?x?????\??°????°?
	tail = tail + 1;//??¨?????????????????????????????????head=(tail + 1) % LEN??¶??´???????????????
}
struct pp dequeue()//???????????°
{
	struct pp x = P[head];//?°?head??????????????´????´?????????\??????x
	head = head + 1;
	return x;//????????????????´?
}
int min(int a, int b)//??????a???b?????´????°???????
{
	return a < b ? a : b;
}
int main()
{
	int alltime=0;//?´??????¶??´  ?±???¨????????????????§????
	int n, q;//n??¨???????????°???q??¨?????¶??´????????§?°?
	struct pp u;
	cin >> n >> q;
	//?°?????????????????????°?????????
	for (int i = 0; i < n; i++)
	{
		scanf("%s%d",& P[i].name,& P[i].time);//cin >> P[i].name >> P[i].time;
	}
	head = 0; tail = n;
	//?¨??????¶??´????????¬???
	while (head != tail)
	{
		u = dequeue();//?????´????´???????
		int c = min(q, u.time);//????????¶??´????????§?°??????\????????????????????¶??´
		u.time = u.time - q;//????????????????????????????????¶??´
		alltime = alltime + c;
		if (u.time > 0)
			enqueue(u);//??????????????¬????????\??°????°?
		else
		{
			printf("%s %d\n",u.name,alltime);//cout << u.name << " " << alltime << endl;
		}
	}
	return 0;
}

Compiler output:
main.c:3:1: error: unknown type name 'using'
    3 | using namespace std;
      | ^~~~~
main.c:3:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    3 | using namespace std;
      |                 ^~~
main.c:9:3: error: variably modified 'P' at file scope
    9 | } P[LEN];
      |   ^
main.c: In function 'main':
main.c:31:9: error: 'cin' undeclared (first use in this function); did you mean 'min'?
   31 |         cin >> n >> q;
      |         ^~~
      |         min
main.c:31:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
const int LEN = 100000;//??????????????§??????
struct pp
{
	char name[10];
	int time;
} P[LEN];
int head, tail, n;
void enqueue(struct pp x)//??\????????°
{
	P[tail] = x;//?°?x?????\??°????°?
	tail = tail + 1;//??¨?????????????????????????????????head=(tail + 1) % LEN??¶??´???????????????
}
struct pp dequeue()//???????????°
{
	struct pp x = P[head];//?°?head??????????????´????´?????????\??????x
	head = head + 1;
	return x;//????????????????´?
}
int min(int a, int b)//??????a???b?????´????°???????
{
	return a < b ? a : b;
}
int main()
{
	int alltime=0;//?´??????¶??´  ?±???¨????????????????§????
	int n, q;//n??¨???????????°???q??¨?????¶??´????????§?°?
	struct pp u;
	scanf("%d%d",&n,&q);
	//?°?????????????????????°?????????
	for (int i = 0; i < n; i++)
	{
		scanf("%s%d",& P[i].name,& P[i].time);//cin >> P[i].name >> P[i].time;
	}
	head = 0; tail = n;
	//?¨??????¶??´????????¬???
	while (head != tail)
	{
		u = dequeue();//?????´????´???????
		int c = min(q, u.time);//????????¶??´????????§?°??????\????????????????????¶??´
		u.time = u.time - q;//????????????????????????????????¶??´
		alltime = alltime + c;
		if (u.time > 0)
			enqueue(u);//??????????????¬????????\??°????°?
		else
		{
			printf("%s %d\n",u.name,alltime);
		}
	}
	return 0;
}

Compiler output:
main.c:7:3: error: variably modified 'P' at file scope
    7 | } P[LEN];
      |   ^
Language: C

#include<stdio.h>
const int LEN = 100000;//??????????????§??????
struct pp
{
	char name[10];
	int time;
} ;
pp P[LEN];
int head, tail, n;
void enqueue(struct pp x)//??\????????°
{
	P[tail] = x;//?°?x?????\??°????°?
	tail = tail + 1;//??¨?????????????????????????????????head=(tail + 1) % LEN??¶??´???????????????
}
struct pp dequeue()//???????????°
{
	struct pp x = P[head];//?°?head??????????????´????´?????????\??????x
	head = head + 1;
	return x;//????????????????´?
}
int min(int a, int b)//??????a???b?????´????°???????
{
	return a < b ? a : b;
}
int main()
{
	int alltime=0;//?´??????¶??´  ?±???¨????????????????§????
	int n, q;//n??¨???????????°???q??¨?????¶??´????????§?°?
	struct pp u;
	scanf("%d%d",&n,&q);
	//?°?????????????????????°?????????
	for (int i = 0; i < n; i++)
	{
		scanf("%s%d",& P[i].name,& P[i].time);//cin >> P[i].name >> P[i].time;
	}
	head = 0; tail = n;
	//?¨??????¶??´????????¬???
	while (head != tail)
	{
		u = dequeue();//?????´????´???????
		int c = min(q, u.time);//????????¶??´????????§?°??????\????????????????????¶??´
		u.time = u.time - q;//????????????????????????????????¶??´
		alltime = alltime + c;
		if (u.time > 0)
			enqueue(u);//??????????????¬????????\??°????°?
		else
		{
			printf("%s %d\n",u.name,alltime);
		}
	}
	return 0;
}

Compiler output:
main.c:8:1: error: unknown type name 'pp'; use 'struct' keyword to refer to the type
    8 | pp P[LEN];
      | ^~
      | struct 
main.c:8:4: error: variably modified 'P' at file scope
    8 | pp P[LEN];
      |    ^
main.c: In function 'enqueue':
main.c:12:19: error: incompatible types when assigning to type 'int' from type 'struct pp'
   12 |         P[tail] = x;//?°?x?????\??°????°?
      |                   ^
main.c: In function 'dequeue':
main.c:17:23: error: invalid initializer
   17 |         struct pp x = P[head];//?°?head??????????????´????´?????????\??????x
      |                       ^
main.c: In function 'main':
main.c:34:36: error: request for member 'name' in something not a structure or union
   34 |                 scanf("%s%d",& P[i].name,& P[i].time);//cin >> P[i].name >> P[i].time;
      |                                    ^
main.c:34:48: error: request for member 'time' in something not a structure or union
   34 |                 scanf("%s%d",& P[i].name,& P[i].time);//cin >> P[i].name >> P[i].time;
      |                                                ^
Language: C

#include <stdio.h>

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

int main(int argc, char const *argv[]) {

  int num,times,i;
  Process Q[200000];
  int count = 0, sum = 0;

  scanf("%d%d",&num,&times);

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

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

    Q[i].t -= times;

    if( Q[i].t <= 0 ){
      sum += Q[i].t+times;
      printf("%s %d\n",Q[i].s,sum);
    }else{
      Q[num] = Q[i];
      sum += times;
      num++;
    }

  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:28: error: 'Process' has no member named 's'
   27 |       printf("%s %d\n",Q[i].s,sum);
      |                            ^
Language: C

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

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

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

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

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


int main(){
  int i, q, T=0;
  P a;
  scanf("%d %d", &n, &q);
  
  for (i=1;i<=n;i++){
    scanf("%s%d", a.name,&a.t);
  }
  
  while(n!=0){
    a=dequeue();
    if(a.t>q){
      a.t=a.t-q; 
      T+=q;
      Enqueue(a);
    } 
    else{
      T=T+a.t;
      printf("%s %d\n",a.name,T);
      n--;
    }
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:40:7: error: implicit declaration of function 'Enqueue'; did you mean 'enqueue'? [-Wimplicit-function-declaration]
   40 |       Enqueue(a);
      |       ^~~~~~~
      |       enqueue
Language: C

#include<stdio.h>
#define MAX 100005
#define N 100

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

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


int main(){
  int i,q,n,T=0;
  P a;
  scanf("%d %d", &n, &q);
  
  for (i=0;i<n;i++){
    scanf("%s%d",a.name,&a.t);
     Enqueue(a);
  }
  
  while(n!=0){
    a=Dequeue();
    if(a.t>q){
      a.t=a.t-q; 
      T+=q;
      Enqueue(a);
    } 
    else{
      T=T+a.t;
      printf("%s %d\n",a.name,T);
      n--;
    }
  }
  
  return 0;
}

void Enqueue(P x){
  if(MAX==tail) tail = 0;
  Q[tail]=x;
  tail++;
}

P Dequeue(void){
  if(head==MAX) head==0;
  return Q[head++];
}

Compiler output:
main.c: In function 'main':
main.c:21:6: error: implicit declaration of function 'Enqueue' [-Wimplicit-function-declaration]
   21 |      Enqueue(a);
      |      ^~~~~~~
main.c:25:7: error: implicit declaration of function 'Dequeue' [-Wimplicit-function-declaration]
   25 |     a=Dequeue();
      |       ^~~~~~~
main.c:25:7: error: incompatible types when assigning to type 'P' from type 'int'
main.c: At top level:
main.c:41:6: warning: conflicting types for 'Enqueue'; have 'void(P)'
   41 | void Enqueue(P x){
      |      ^~~~~~~
main.c:21:6: note: previous implicit declaration of 'Enqueue' with type 'void(P)'
   21 |      Enqueue(a);
      |      ^~~~~~~
main.c:47:3: error: conflicting types for 'Dequeue'; have 'P(void)'
   47 | P Dequeue(void){
      |   ^~~~~~~
main.c:25:7: note: previous implicit declaration of 'Dequeue' with type 'int()'
   25 |     a=Dequeue();
      |       ^~~~~~~
Language: C

#include<stdio.h>

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


int main(){

  int n,q,i;
  struct data Q[100000];

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

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

  while(1){
    

  return 0;
}

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

#include<stdio.h>
#include<string.h>
typedef struct  {
  char name[100];
  int t;
  
} P;
P Q[100000];
int head,tail,n;
void initialize(){
  head=0;
    tail=0;
}
int isEmpty(){
  if(head==tail){
    return ;
  }
}
void enqueue(P x){
  if (isFull()){
    fprintf(stderr,"Overflow");
  }
 


  Q[tail]=x;
  if(tail+1==100000){
    tail=0;
  }
  else tail++;
}

P dequeue(){
  if (isEmpty){
    fprintf(stderr,"Underflow");
  }
  P x=Q[head];
  if(head+1==100000){
    head=0;
  }
  else head++;
  return x;
  
}
int min(int a,int b){
  return a<b ? a:b;
}
int main(){
  int L=0,c;
  int i,q;
  P a;
  scanf("%d%d",&n,&q);
  for(i=0;i<n;i++){
    scanf("%s",&Q[i+1].name);
    scanf("%d",&Q[i+1].t);
  }

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

Compiler output:
main.c: In function 'isEmpty':
main.c:16:5: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   16 |     return ;
      |     ^~~~~~
main.c:14:5: note: declared here
   14 | int isEmpty(){
      |     ^~~~~~~
main.c: In function 'enqueue':
main.c:20:7: error: implicit declaration of function 'isFull' [-Wimplicit-function-declaration]
   20 |   if (isFull()){
      |       ^~~~~~
Language: C

#include<stdio.h>
#define LEN 100010
#define T 1
#define F 2

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

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

int isEmpty() {
  if(head == tail) return T;
  else return F;
}

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

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

Compiler output:
main.c: In function 'dequeue':
main.c:28:12: error: incompatible types when returning type 'int' but 'P' {aka 'struct pp'} was expected
   28 |     return head;
      |            ^~~~
Language: C

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

int min(int,int);

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

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

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

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

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

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

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

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

Compiler output:
main.c: In function 'main':
main.c:43:15: error: 't' undeclared (first use in this function)
   43 |     c=min(q,u,t);
      |               ^
main.c:43:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:43:13: error: incompatible type for argument 2 of 'min'
   43 |     c=min(q,u,t);
      |             ^
      |             |
      |             P {aka struct pp}
main.c:26:19: note: expected 'int' but argument is of type 'P' {aka 'struct pp'}
   26 | int min(int a,int b){return a<b?a:b;}
      |               ~~~~^
main.c:43:7: error: too many arguments to function 'min'
   43 |     c=min(q,u,t);
      |       ^~~
main.c:26:5: note: declared here
   26 | int min(int a,int b){return a<b?a:b;}
      |     ^~~
main.c:45:5: error: 'eplas' undeclared (first use in this function)
   45 |     eplas+=c;
      |     ^~~~~
Language: C

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

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

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

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

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

}

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

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

  head = 1;
  tail = n+1;

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

Compiler output:
main.c: In function 'main':
main.c:48:9: error: implicit declaration of function 'dequence'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   48 |     u = dequence();
      |         ^~~~~~~~
      |         dequeue
main.c:48:9: error: incompatible types when assigning to type 'P' {aka 'struct pp'} from type 'int'
Language: C

#include<stdio.h>
#define LEN 100000
#define Q 1000
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;
  head++;
}

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


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

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

Compiler output:
main.c:3:11: error: expected identifier or '(' before numeric constant
    3 | #define Q 1000
      |           ^~~~
main.c:9:3: note: in expansion of macro 'Q'
    9 | P Q[LEN+1];
      |   ^
main.c: In function 'enqueue':
main.c:14:4: error: subscripted value is neither array nor pointer nor vector
   14 |   Q[tail]=x;
      |    ^
main.c: In function 'dequeue':
main.c:20:11: error: subscripted value is neither array nor pointer nor vector
   20 |   return Q[head];
      |           ^
main.c: In function 'main':
main.c:31:18: error: subscripted value is neither array nor pointer nor vector
   31 |     scanf("%s", Q[i].name);
      |                  ^
main.c:32:19: error: subscripted value is neither array nor pointer nor vector
   32 |     scanf("%d", &Q[i].t);
      |                   ^
main.c:39:9: error: subscripted value is neither array nor pointer nor vector
   39 |     if(Q[head].t-q<=0){
      |         ^
main.c:40:20: error: subscripted value is neither array nor pointer nor vector
   40 |       elaps=elaps+Q[head].t;
      |                    ^
main.c:41:25: error: subscripted value is neither array nor pointer nor vector
   41 |       printf("%s %d\n",Q[head].name,elaps);
      |                         ^
main.c:44:14: error: subscripted value is neither array nor pointer nor vector
   44 |     else if(Q[head].t-q>0){
      |              ^
main.c:45:16: error: subscripted value is neither array nor pointer nor vector
   45 |       enqueue(Q[head]);
      |                ^
main.c:46:8: error: subscripted value is neither array nor pointer nor vector
   46 |       Q[tail].t=Q[tail].t-q;
      |        ^
main.c:46:18: error: subscripted value is neither array nor pointer nor vector
   46 |       Q[tail].t=Q[tail].t-q;
      |                  ^
main.c:49:9: error: subscripted value is neither array nor pointer nor vector
   49 |     if(Q[head].t<=0)break;
      |         ^
Language: C

#include<stdio.h>
#define LEN 100000
#define Q 1000
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;
  head++;
}

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


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

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

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

Compiler output:
main.c:3:11: error: expected identifier or '(' before numeric constant
    3 | #define Q 1000
      |           ^~~~
main.c:9:3: note: in expansion of macro 'Q'
    9 | P Q[LEN+1];
      |   ^
main.c: In function 'enqueue':
main.c:14:4: error: subscripted value is neither array nor pointer nor vector
   14 |   Q[tail]=x;
      |    ^
main.c: In function 'dequeue':
main.c:20:11: error: subscripted value is neither array nor pointer nor vector
   20 |   return Q[head];
      |           ^
main.c: In function 'main':
main.c:31:18: error: subscripted value is neither array nor pointer nor vector
   31 |     scanf("%s", Q[i].name);
      |                  ^
main.c:32:19: error: subscripted value is neither array nor pointer nor vector
   32 |     scanf("%d", &Q[i].t);
      |                   ^
main.c:39:9: error: subscripted value is neither array nor pointer nor vector
   39 |     if(Q[head].t-q<=0){
      |         ^
main.c:40:20: error: subscripted value is neither array nor pointer nor vector
   40 |       elaps=elaps+Q[head].t;
      |                    ^
main.c:41:25: error: subscripted value is neither array nor pointer nor vector
   41 |       printf("%s %d\n",Q[head].name,elaps);
      |                         ^
main.c:44:14: error: subscripted value is neither array nor pointer nor vector
   44 |     else if(Q[head].t-q>0){
      |              ^
main.c:45:16: error: subscripted value is neither array nor pointer nor vector
   45 |       enqueue(Q[head]);
      |                ^
main.c:46:8: error: subscripted value is neither array nor pointer nor vector
   46 |       Q[tail].t=Q[tail].t-q;
      |        ^
main.c:46:18: error: subscripted value is neither array nor pointer nor vector
   46 |       Q[tail].t=Q[tail].t-q;
      |                  ^
main.c:49:9: error: subscripted value is neither array nor pointer nor vector
   49 |     if(Q[head].t<=0)break;
      |         ^
Language: C

#include<stdio.h>
#define LEN 100000

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;
  head++;
}

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

int main(){
  int elaps = 0;
  int i, q,status;
  P u;
  status=scanf("%d %d", &n, &q);
  if(n>=LEN)printf("Too Large");
  else (status==EOF)printf("Too Large");
  for ( i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
    tail++;
  }
  head=1;
  tail=n;
  while(1){

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

Compiler output:
main.c: In function 'main':
main.c:29:21: error: expected ';' before 'printf'
   29 |   else (status==EOF)printf("Too Large");
      |                     ^~~~~~
      |                     ;
Language: C

#include <stdio.h>
#include <stdlib.h>
#define MAX 100000
typedef struct pp{
  char name[100];
  int t;
}P;

P Q1[MAX+1],Q2[MAX+1];

void initialize(void);
int isEmpty(void);
int isFull(void);
void enqueue(P x);
P dequeue(void);
int tail,head,n;
int main(){
  int x,time=0,i,t;
  char elaps[100];
  P q;
  scanf("%d %d",&n,&t);

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

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

int isEmpty(void){
  if( head == tail)return 0;//kara
  else return 1;
}
int isFull(void){
  if (head == (tail+1) % MAX) return 0; //manpai
  else return 1;
}
void enqueue(P x){

  if(isFull()== 0){
    fprintf(stderr,"??¨?????????????????????????????????\n");
    exit(8);
  }
  Q2[tail] = x;
  if(tail ==n+1)tail=0;
  else tail++;
}
P  dequeue(void){
  P x;
  if(isEmpty()== 0){
    fprintf(stderr,"??¨???????????¢?????????????????????\n");
    exit(8);
  }
  x = Q2[head];
  if (head ==n+1)head = 0;
  else head++;
  return x;

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

#include<stdio.h>
#define LEN 100000
#define A 1000
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;
  head++;
}

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

int main(){
  int elaps = 0;
  int i, q,status;
  P u;
  status=scanf("%d %d", &n, &q);
  if(n>=LEN)printf("Too Large");
  else (status==EOF)printf("Too Large");
  for ( i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
    tail++;
  }
  head=1;
  tail=n;
  while(1){

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

Compiler output:
main.c: In function 'main':
main.c:29:21: error: expected ';' before 'printf'
   29 |   else (status==EOF)printf("Too Large");
      |                     ^~~~~~
      |                     ;
Language: C

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

#define MAX 100005

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

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

void enqueue(Q);
Q dequeue(void);

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

  while(i!=n){
    p = dequeue();
    if(p.time>q) {
      p.time = p.time-q;
      enqueue(p);
      sum_t += q;
    }
    else{
      sum_t += p.time;
      p.time = sum_t;
      data[i]=p;
      printf("%s %d\n",data[i].name,data[i].time);
      i++;
    }
  }


  fclose(fp);

  return 0;
}

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

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

Compiler output:
main.c: In function 'main':
main.c:46:10: error: 'fp' undeclared (first use in this function); did you mean 'p'?
   46 |   fclose(fp);
      |          ^~
      |          p
main.c:46:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C


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

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

    if(time[i]<=q && time[i]>=0){
      printf("%s %d\n",name[i],alltime+time[i]);
      alltime+=time[i];
      time[i]=-1;
      flag+=1;
    }

    else if(time[i]>q){
      alltime+=q;
      time[i]-=q;
    }
     if((i+1)%n==0) i=-1;
     if(flag==n)break;
       
  }
  return 0;
}

Compiler output:
main.c:2:3: error: expected identifier or '(' before 'for'
    2 |   for(i=0;i<n;i++){
      |   ^~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    2 |   for(i=0;i<n;i++){
      |            ^
main.c:2:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    2 |   for(i=0;i<n;i++){
      |                ^~
main.c:7:3: error: expected identifier or '(' before 'for'
    7 |   for(i=0;i<n;i++){
      |   ^~~
main.c:7:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    7 |   for(i=0;i<n;i++){
      |            ^
main.c:7:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    7 |   for(i=0;i<n;i++){
      |                ^~
main.c:24:3: error: expected identifier or '(' before 'return'
   24 |   return 0;
      |   ^~~~~~
main.c:25:1: error: expected identifier or '(' before '}' token
   25 | }
      | ^
Language: C

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

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

int n, head = 0, tail = 0;
Data Q[1000];

void enqueue(Data);
Data dequeue(void);

int main(){
  int i, q, t = 0, count = 0;
  struct Data data;

  scanf("%d %d",&n, &q);
  for(i = 0; i < n; i++){
    scanf("%s%d",Q[i].name, &Q[i].time);
  }
  while(count < n){
    data = dequeue();
    if(data.time <= q){
      t += data.time;
      count++;
      printf("%s %d\n",data.name, t);
    }
    else{
      t += q;
      data.time -= q;
      enqueue(data);
    }
  }
  
  return 0;
}

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

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

Compiler output:
main.c: In function 'main':
main.c:17:15: error: storage size of 'data' isn't known
   17 |   struct Data data;
      |               ^~~~
Language: C

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

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

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

void enqueue(P x){

  Q[tail] = x;
  tail = (tail + 1) % LEN;
}


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

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

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

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

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


  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:49:7: error: implicit declaration of function 'prntf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   49 |       prntf("%s %d\n",u.name, elaps);
      |       ^~~~~
      |       printf
Language: C

#include<stdio.h>
#define LEN 1000

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

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

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

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

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

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

Compiler output:
main.c: In function 'main':
main.c:41:14: error: expected ';' before 'printf'
   41 |       u.t = 0
      |              ^
      |              ;
   42 |       printf("%s %d\n", u.name, elaps);
      |       ~~~~~~