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

#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define LEN 100005

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

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

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

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

int roundrobin(int rest,int q){
	if (q < rest){
		time += q;
		rest -= q;
	}
	else{
		time += rest;
		rest = 0;
	}
	return rest;
}

int main(){
	time = 0;
	P u;
	int q;
	scnaf("%d", &n);
	scanf("%d", &q);
	for(int i=1;i<=n;i++){
		scanf("%s %d", Q[i].name, &Q[i].t);
	}
	head = 1;
	tail = n + 1;
	while (head != tail){
		u = decueue();
		u.t = roundrobin(u.t, q);
		if (u.t > 0){
			enqueue(u);
		}
		else{
			printf("%s %d", u.name, time);
		}
	}
	return 0;
}

Compiler output:
a.cc:13:19: error: 'int time' redeclared as different kind of entity
   13 | int head, tail, n,time;
      |                   ^~~~
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'void dequeue()':
a.cc:23:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   23 |         return x;
      |                ^
a.cc: In function 'int roundrobin(int, int)':
a.cc:28:22: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   28 |                 time += q;
      |                 ~~~~~^~~~
a.cc:28:22: error: assignment of read-only location 'time'
a.cc:32:22: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                 time += rest;
      |                 ~~~~~^~~~~~~
a.cc:32:22: error: assignment of read-only location 'time'
a.cc: In function 'int main()':
a.cc:39:14: error: assignment of function 'time_t time(time_t*)'
   39 |         time = 0;
      |         ~~~~~^~~
a.cc:42:9: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
   42 |         scnaf("%d", &n);
      |         ^~~~~
      |         scanf
a.cc:50:21: error: 'decueue' was not declared in this scope; did you mean 'dequeue'?
   50 |                 u = decueue();
      |                     ^~~~~~~
      |                     dequeue
Language: C++

#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define LEN 100005

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

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

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

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

int roundrobin(int rest,int q){
	if (q < rest){
		total += q;
		rest -= q;
	}
	else{
		total += rest;
		rest = 0;
	}
	return rest;
}

int main(){
	total = 0;
	P u;
	int q;
	scnaf("%d", &n);
	scanf("%d", &q);
	for(int i=1;i<=n;i++){
		scanf("%s %d", Q[i].name, &Q[i].t);
	}
	head = 1;
	tail = n + 1;
	while (head != tail){
		u = decueue();
		u.t = roundrobin(u.t, q);
		if (u.t > 0){
			enqueue(u);
		}
		else{
			printf("%s %d", u.name, time);
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'void dequeue()':
a.cc:23:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   23 |         return x;
      |                ^
a.cc: In function 'int main()':
a.cc:42:9: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
   42 |         scnaf("%d", &n);
      |         ^~~~~
      |         scanf
a.cc:50:21: error: 'decueue' was not declared in this scope; did you mean 'dequeue'?
   50 |                 u = decueue();
      |                     ^~~~~~~
      |                     dequeue
Language: C++

#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define LEN 100005

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

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

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

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

int roundrobin(int rest,int q){
	if (q < rest){
		total += q;
		rest -= q;
	}
	else{
		total += rest;
		rest = 0;
	}
	return rest;
}

int main(){
	total = 0;
	P u;
	int q;
	scnaf("%d", &n);
	scanf("%d", &q);
	for(int i=1;i<=n;i++){
		scanf("%s %d", Q[i].name, &Q[i].t);
	}
	head = 1;
	tail = n + 1;
	while (head != tail){
		u = decueue();
		u.t = roundrobin(u.t, q);
		if (u.t > 0){
			enqueue(u);
		}
		else{
			printf("%s %d", u.name, time);
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
   42 |         scnaf("%d", &n);
      |         ^~~~~
      |         scanf
a.cc:50:21: error: 'decueue' was not declared in this scope; did you mean 'dequeue'?
   50 |                 u = decueue();
      |                     ^~~~~~~
      |                     dequeue
Language: C++

#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define LEN 100005

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

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

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

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

int roundrobin(int rest,int q){
	if (q < rest){
		total += q;
		rest -= q;
	}
	else{
		total += rest;
		rest = 0;
	}
	return rest;
}

int main(){
	total = 0;
	P u;
	int q;
	scanf("%d", &n);
	scanf("%d", &q);
	for(int i=1;i<=n;i++){
		scanf("%s %d", Q[i].name, &Q[i].t);
	}
	head = 1;
	tail = n + 1;
	while (head != tail){
		u = decueue();
		u.t = roundrobin(u.t, q);
		if (u.t > 0){
			enqueue(u);
		}
		else{
			printf("%s %d", u.name, time);
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:21: error: 'decueue' was not declared in this scope; did you mean 'dequeue'?
   50 |                 u = decueue();
      |                     ^~~~~~~
      |                     dequeue
Language: C++

#include<stdio.h>
#include<algorithm>
#include<iostream>
using namespace std;
#define LEN 100005

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

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

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

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

int roundrobin(int rest, int q){
	if (rest > q){
		total += q;
		rest -= q;
	}
	else{
		total += rest;
		rest = 0;
	}
	return rest;
}

int main(){
	P u;
	int q;
	scanf("%d %d", &n, &q);
	for (int i = 1; i <= n; i++){
		scanf("%s %d", Q[i].name, &Q[i].t);
	}
	head = 1;
	tail = n + 1;
	total = 0;
	while (head != tail){
		u = decueue();
		u.t = roundrobin(u.t, q);
		if (u.t > 0){
			encueue(u);
		}
		else{
			printf("%s %d", u.name, total);
		}
	}
	return 0;
}

Compiler output:
a.cc:7:8: error: expected identifier before 'typedef'
    7 | struct typedef pp{
      |        ^~~~~~~
a.cc:7:16: error: typedef 'pp' is initialized (use 'decltype' instead)
    7 | struct typedef pp{
      |                ^~
a.cc:8:9: error: expected primary-expression before 'char'
    8 |         char name[100];
      |         ^~~~
a.cc:8:9: error: expected '}' before 'char'
a.cc:7:18: note: to match this '{'
    7 | struct typedef pp{
      |                  ^
a.cc:10:1: error: expected declaration before '}' token
   10 | }P;
      | ^
a.cc:10:2: error: 'P' does not name a type
   10 | }P;
      |  ^
a.cc:12:1: error: 'P' does not name a type
   12 | P Q[LEN];
      | ^
a.cc:15:6: error: variable or field 'encueue' declared void
   15 | void encueue(P x){
      |      ^~~~~~~
a.cc:15:14: error: 'P' was not declared in this scope
   15 | void encueue(P x){
      |              ^
a.cc:20:1: error: 'P' does not name a type
   20 | P decueue(){
      | ^
a.cc: In function 'int main()':
a.cc:39:9: error: 'P' was not declared in this scope
   39 |         P u;
      |         ^
a.cc:43:32: error: 'Q' was not declared in this scope
   43 |                 scanf("%s %d", Q[i].name, &Q[i].t);
      |                                ^
a.cc:49:17: error: 'u' was not declared in this scope
   49 |                 u = decueue();
      |                 ^
a.cc:49:21: error: 'decueue' was not declared in this scope
   49 |                 u = decueue();
      |                     ^~~~~~~
a.cc:52:25: error: 'encueue' was not declared in this scope
   52 |                         encueue(u);
      |                         ^~~~~~~
Language: C++

#include<stdio.h>
#define T 50000
int main(){
  int n,q,time[T],i=0,k,alltime=0,flag=0;
  char name[100000][10];

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: expected primary-expression before ')' token
   14 |   while(){
      |         ^
Language: C++

#include "stdafx.h"
#include<iostream>
#include<string>
#include<queue>
#include<algorithm>
using namespace std;

struct Data {
	int n;
	string name;
};

int main() {
	int N;
	int timeStep;
	int time = 0;
	queue<Data> datas;
	queue<Data> ends;

	cin >> N;
	cin >> timeStep;

	for (int i = 0; i < N; i++) {
		Data buf;
		cin >> buf.name >> buf.n;
		datas.push(buf);
	}

	while (!datas.empty()) {
		Data d = datas.front();

		time += min(d.n, timeStep);
		d.n -= timeStep;

		if (d.n <= 0) {
			Data temp;
			temp.name = d.name;
			temp.n = time;
			ends.push(temp);
		}
		else {
			datas.push(d);
		}

		datas.pop();
	}

	while (!ends.empty()) {
		cout << ends.front().name << " " << ends.front().n << endl;
		ends.pop();
	}
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

int MAX = 100000;
int Q[MAX], head, tail;

struct Proc {string name; int t;};

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

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

int main() {
        int elaps = 0, c, i, q, n;
        Proc u;
        cin >> n >> q;
        for(i = 0; i < n; i++) {
                cin >> Q[i].name >> Q[i].t;
        }
        head = 0; tail = n;
        while(head != tail) {
                u = dequeue();
                c = min(q, u.t);
                u.t -= c;
                elaps += c;
                if(u.t > 0) enqueue(u);
                else {
                        cout << u.name << elaps << endl;
                }
        }
        return 0;
}

Compiler output:
a.cc:7:7: error: size of array 'Q' is not an integral constant-expression
    7 | int Q[MAX], head, tail;
      |       ^~~
a.cc: In function 'void enqueue(Proc)':
a.cc:12:19: error: cannot convert 'Proc' to 'int' in assignment
   12 |         Q[tail] = x;
      |                   ^
      |                   |
      |                   Proc
a.cc: In function 'Proc dequeue()':
a.cc:17:24: error: conversion from 'int' to non-scalar type 'Proc' requested
   17 |         Proc x = Q[head];
      |                  ~~~~~~^
a.cc:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
   19 | }
      | ^
a.cc: In function 'int main()':
a.cc:26:29: error: request for member 'name' in 'Q[i]', which is of non-class type 'int'
   26 |                 cin >> Q[i].name >> Q[i].t;
      |                             ^~~~
a.cc:26:42: error: request for member 't' in 'Q[i]', which is of non-class type 'int'
   26 |                 cin >> Q[i].name >> Q[i].t;
      |                                          ^
Language: C++

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

int Q[100000], head, tail;

struct Proc {string name; int t;};

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

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

int main() {
        int elaps = 0, c, i, q, n;
        Proc u;
        cin >> n >> q;
        for(i = 0; i < n; i++) {
                cin >> Q[i].name >> Q[i].t;
        }
        head = 0; tail = n;
        while(head != tail) {
                u = dequeue();
                c = min(q, u.t);
                u.t -= c;
                elaps += c;
                if(u.t > 0) enqueue(u);
                else {
                        cout << u.name << elaps << endl;
                }
        }
        return 0;
}

Compiler output:
a.cc: In function 'void enqueue(Proc)':
a.cc:11:19: error: cannot convert 'Proc' to 'int' in assignment
   11 |         Q[tail] = x;
      |                   ^
      |                   |
      |                   Proc
a.cc:12:29: error: 'MAX' was not declared in this scope
   12 |         tail = (tail + 1) % MAX;
      |                             ^~~
a.cc: In function 'Proc dequeue()':
a.cc:16:24: error: conversion from 'int' to non-scalar type 'Proc' requested
   16 |         Proc x = Q[head];
      |                  ~~~~~~^
a.cc:17:29: error: 'MAX' was not declared in this scope
   17 |         head = (head + 1) % MAX;
      |                             ^~~
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      | ^
a.cc: In function 'int main()':
a.cc:25:29: error: request for member 'name' in 'Q[i]', which is of non-class type 'int'
   25 |                 cin >> Q[i].name >> Q[i].t;
      |                             ^~~~
a.cc:25:42: error: request for member 't' in 'Q[i]', which is of non-class type 'int'
   25 |                 cin >> Q[i].name >> Q[i].t;
      |                                          ^
Language: C++

#include <iostream>
#include <string>
#include <cassert>
#include <list>

struct Proc{
	std::string name;
	int time;
};

typedef std::list<Proc> PList;
void output(const PList& vec);
PList calc(PList vec, int q);

///-------------------------------------------------
int main()
{
	PList ivec;
	int n;
	std::cin >> n;
	int q;
	std::cin >> q;
	for(int i = 0; i < n; i++){
		Proc proc;
		std::cin >> proc.name;
		std::cin >> proc.time;
		vec.push_back(proc);
	}
	PList ovec = calc(ivec,q);
	for(PList::const_iterator itr = ovec.begin(); itr != ovec.end(); itr++){
		std::cout << itr->name << " " << itr->time << std::endl;
	}
	return 0;
}
///--------------------------------------------
///-------------------------------------------------
PList calc(PList queue, int q)
{
	PList vec;
	int  time = 0;
	while(!queue.empty()){
		if(queue.front().time > q){
			time += q;
			queue.front().time -= q;
			queue.push_back(queue.front());
		}else{
			time += queue.front().time;
			queue.front().time = time;
			vec.push_back(queue.front());
		}
		queue.pop_front();
	}
	return vec;
}
///-------------------------------------------------

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 'vec' was not declared in this scope; did you mean 'ivec'?
   27 |                 vec.push_back(proc);
      |                 ^~~
      |                 ivec
Language: C++

#include <iostream>
#include <string>
#include <cassert>
#include <queue>

struct Proc{
	std::string name;
	int time;
};

typedef std::queue<Proc> PList;
void output(const PList& vec);
PList calc(PList vec, int q);

///-------------------------------------------------
int main()
{
	PList ivec;
	int n;
	std::cin >> n;
	int q;
	std::cin >> q;
	for(int i = 0; i < n; i++){
		Proc proc;
		std::cin >> proc.name;
		std::cin >> proc.time;
		ivec.push_back(proc);
	}
	PList ovec = calc(ivec,q);
	for(PList::const_iterator itr = ovec.begin(); itr != ovec.end(); itr++){
		std::cout << itr->name << " " << itr->time << std::endl;
	}
	return 0;
}
///--------------------------------------------
///-------------------------------------------------
PList calc(PList queue, int q)
{
	PList vec;
	int  time = 0;
	while(!queue.empty()){
		if(queue.front().time > q){
			time += q;
			queue.front().time -= q;
			queue.push_back(queue.front());
		}else{
			time += queue.front().time;
			queue.front().time = time;
			vec.push_back(queue.front());
		}
		queue.pop_front();
	}
	return vec;
}
///-------------------------------------------------

Compiler output:
a.cc: In function 'int main()':
a.cc:27:22: error: 'PList' {aka 'class std::queue<Proc>'} has no member named 'push_back'
   27 |                 ivec.push_back(proc);
      |                      ^~~~~~~~~
a.cc:30:20: error: 'const_iterator' is not a member of 'PList' {aka 'std::queue<Proc>'}
   30 |         for(PList::const_iterator itr = ovec.begin(); itr != ovec.end(); itr++){
      |                    ^~~~~~~~~~~~~~
a.cc:30:55: error: 'itr' was not declared in this scope
   30 |         for(PList::const_iterator itr = ovec.begin(); itr != ovec.end(); itr++){
      |                                                       ^~~
a.cc:30:67: error: 'PList' {aka 'class std::queue<Proc>'} has no member named 'end'
   30 |         for(PList::const_iterator itr = ovec.begin(); itr != ovec.end(); itr++){
      |                                                                   ^~~
a.cc: In function 'PList calc(PList, int)':
a.cc:45:31: error: 'PList' {aka 'class std::queue<Proc>'} has no member named 'push_back'
   45 |                         queue.push_back(queue.front());
      |                               ^~~~~~~~~
a.cc:49:29: error: 'PList' {aka 'class std::queue<Proc>'} has no member named 'push_back'
   49 |                         vec.push_back(queue.front());
      |                             ^~~~~~~~~
a.cc:51:23: error: 'PList' {aka 'class std::queue<Proc>'} has no member named 'pop_front'
   51 |                 queue.pop_front();
      |                       ^~~~~~~~~
Language: C++

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

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

void enqueue(P);
P dequeue(void);

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:33:9: error: 'min' was not declared in this scope; did you mean 'main'?
   33 |       c=min(q,u.t);
      |         ^~~
      |         main
Language: C++

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

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

void enqueue(P);
P dequeue(void);

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

int main()
{
  int elaps=0,c;
  int i,q;
  P u;
  scanf("%d %d",&n,&q);
  c=100;
  for (i=0;i<n;i++)
    {
      scanf("%s",Q[i].name);
      scanf("%d",&Q[i].t);
    }
head++,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;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: error: 'min' was not declared in this scope; did you mean 'main'?
   34 |       c=min(q,u.t);
      |         ^~~
      |         main
Language: C++

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

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

void enqueue(P);
P dequeue(void);

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

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

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

  return 0;
}

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

Compiler output:
/usr/bin/ld: /tmp/ccPHGztJ.o: in function `main':
a.cc:(.text+0x10a): undefined reference to `dequeue()'
collect2: error: ld returned 1 exit status
Language: C++

#include <stdio.h>
#include <string.h>
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

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

Compiler output:
a.cc:16:19: error: 'acos' was not declared in this scope
   16 | const double PI = acos(-1);
      |                   ^~~~
a.cc: In function 'int main()':
a.cc:51:19: error: 'cin' was not declared in this scope
   51 |         int n, q; cin >> n >> q;
      |                   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <string.h>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:62:25: error: 'min' was not declared in this scope; did you mean 'main'?
   62 |                 int x = min(q, tmp.time);
      |                         ^~~
      |                         main
Language: C++

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

int main() {
  queue<pair<string, int> > Q;

  cin >> n >> q;

  for ( int i = 0; i < n; i++ ) {
    cin >> name >> t;
    Q.push(make_pair(name, t));
  }

  pair<string, int> u;
  int elaps = 0, a;

  while ( !Q.empty() ) {
    u = Q.front(); Q.pop();
    a = min(u.second, q);
    u.second -= a;
    if ( u.second > 0 ) {
      Q.push(u);
    } else {
      cout << u.first << " " << elaps << endl;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'n' was not declared in this scope
   10 |   cin >> n >> q;
      |          ^
a.cc:10:15: error: 'q' was not declared in this scope
   10 |   cin >> n >> q;
      |               ^
a.cc:13:12: error: 'name' was not declared in this scope; did you mean 'tzname'?
   13 |     cin >> name >> t;
      |            ^~~~
      |            tzname
a.cc:13:20: error: 't' was not declared in this scope
   13 |     cin >> name >> t;
      |                    ^
Language: C++

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

class Proc{
	public:
		string nam;
		int tim;
		Proc(){
			nam="";
			tim=0;
		}
};

Proc Q[100001];

class Queue{
	private:
		int fp;
		int rp;
	public:
		Queue(){
			fp=0;
			rp=0;
		}
		int next(int p)const{
			return (p+1)%100001;
		}
		bool isFull()const{
			return (next(rp)==fp);
		}
		bool isEmpty()const{
			return (rp==fp);
		}
		void push(Proc d);
		Proc front();
		void pop();
};

void Queue::push(Proc d){
	if(isFull()){
		return;
	}
	Q[rp]=d;
	rp==next(rp);
}

void Queue::front(){
	if(isEmpty()){
		Proc er;
		er.tim=-1;
		return er;
	}
	return Q[fp];
}

void Queue::pop(){
	if(isEmpty()){
		return;
	}
	fp=next(fp);
}


int main(){
	Queue que;
	int n,q;
	cin>>n>>q;
	forint i=0;i<n;i++){
		Proc p;
		cin>>p.nam>>p.tim;
		que.push(p);
	}
	int total_tim=0;
	while(!que.isEmpty()){
		Proc p=que.front();
		que.pop();
		if(p.tim<=q){
			total_tim+=p.tim;
			cout<<p.nam<<' '<<total_tim<<endl;
		}else{
			total_tim+=q;
			p.tim-=q;
			que.push(p);
		}
	}
	return 0;
}

Compiler output:
a.cc:48:6: error: no declaration matches 'void Queue::front()'
   48 | void Queue::front(){
      |      ^~~~~
a.cc:36:22: note: candidate is: 'Proc Queue::front()'
   36 |                 Proc front();
      |                      ^~~~~
a.cc:17:7: note: 'class Queue' defined here
   17 | class Queue{
      |       ^~~~~
a.cc: In function 'int main()':
a.cc:69:9: error: 'forint' was not declared in this scope; did you mean 'fprintf'?
   69 |         forint i=0;i<n;i++){
      |         ^~~~~~
      |         fprintf
a.cc:69:20: error: 'i' was not declared in this scope
   69 |         forint i=0;i<n;i++){
      |                    ^
Language: C++

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

class Proc {
public:
	string nam;
	int tim;
	proc() { nam = ""; tim = 0; }
};

Proc Q[100001];

class Queue {
private:
	int fp;
	int rp;
public:
	Queue() {
		fp = 0; rp = 0;
	}
	int next(int p) const {
		return (p + 1) % 100001;
	}
	bool isFull() const {
		return (next(rp) == fp);
	}
	bool isEmpty() const {
		return(rp == fp);
	}
	void push(Proc d);
	Proc frout();
	void pop();
};

void Queue::push(Proc d)
{
	if (isFull())
		return;
	Q[rp] = d;
	rp = next(rp);
}
void Queue::front()
{
	if (isEmpty()) {
		Proc er;
		er.tim = -1;
		return er;
	}
	return Q[fp];
}
void Queue::pop()
{
	if (isEmpty())
		return;
	fp = next(fp);

}

int main()
{
	Queue que;

	int n, q;
	cin >> n >> q;

	for (int i = 0; i < n; i++) {
		Proc p;
		cin >> p.nam >> p.tim;

		que.push(p);

	}

	int total_tim = 0;

	while (!que.isEmpty()) {
		Proc p = que.frout(); que.pop();

		if (p.tim <= q) {
			total_tim += p.tim;

			cout << p.nam << ' ' << total_tim << endl;
		}
		else {
			total_tim += q;
			p.tim -= q;

			que.push(p);

		}
	}
	return 0;
}

Compiler output:
a.cc:10:9: error: ISO C++ forbids declaration of 'proc' with no type [-fpermissive]
   10 |         proc() { nam = ""; tim = 0; }
      |         ^~~~
a.cc: In member function 'int Proc::proc()':
a.cc:10:37: warning: no return statement in function returning non-void [-Wreturn-type]
   10 |         proc() { nam = ""; tim = 0; }
      |                                     ^
a.cc: At global scope:
a.cc:44:6: error: no declaration matches 'void Queue::front()'
   44 | void Queue::front()
      |      ^~~~~
a.cc:44:6: note: no functions named 'void Queue::front()'
a.cc:15:7: note: 'class Queue' defined here
   15 | class Queue {
      |       ^~~~~
Language: C++

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

class Proc {
public:
	string nam;
	int tim;
	proc() { nam = ""; tim = 0; }
};

Proc Q[100001];

class Queue {
private:
	int fp;
	int rp;
public:
	Queue() {
		fp = 0; rp = 0;
	}
	int next(int p) const {
		return (p + 1) % 100001;
	}
	bool isFull() const {
		return (next(rp) == fp);
	}
	bool isEmpty() const {
		return(rp == fp);
	}
	void push(Proc d);
	Proc frout();
	void pop();
};

void Queue::push(Proc d)
{
	if (isFull())
		return;
	Q[rp] = d;
	rp = next(rp);
}
Proc Queue::front()
{
	if (isEmpty()) {
		Proc er;
		er.tim = -1;
		return er;
	}
	return Q[fp];
}
void Queue::pop()
{
	if (isEmpty())
		return;
	fp = next(fp);

}

int main()
{
	Queue que;

	int n, q;
	cin >> n >> q;

	for (int i = 0; i < n; i++) {
		Proc p;
		cin >> p.nam >> p.tim;

		que.push(p);

	}

	int total_tim = 0;

	while (!que.isEmpty()) {
		Proc p = que.frout(); que.pop();

		if (p.tim <= q) {
			total_tim += p.tim;

			cout << p.nam << ' ' << total_tim << endl;
		}
		else {
			total_tim += q;
			p.tim -= q;

			que.push(p);

		}
	}
	return 0;
}

Compiler output:
a.cc:10:9: error: ISO C++ forbids declaration of 'proc' with no type [-fpermissive]
   10 |         proc() { nam = ""; tim = 0; }
      |         ^~~~
a.cc: In member function 'int Proc::proc()':
a.cc:10:37: warning: no return statement in function returning non-void [-Wreturn-type]
   10 |         proc() { nam = ""; tim = 0; }
      |                                     ^
a.cc: At global scope:
a.cc:44:6: error: no declaration matches 'Proc Queue::front()'
   44 | Proc Queue::front()
      |      ^~~~~
a.cc:44:6: note: no functions named 'Proc Queue::front()'
a.cc:15:7: note: 'class Queue' defined here
   15 | class Queue {
      |       ^~~~~
Language: C++

#include<iostream>
#include<queue>
#include<string>
#define P pair<string,int>
using namespace std;

queue<P> d;

int n,q,t,time;
string s;

int main(){
	cin>>n>>q;
	for(int i=0;i<n;i++){
		cin>>s>>t;
		d.push(P(s,t));
	}
	while(d.empty()!=1){
		if(d.front().second<=q){
			time+=d.front().second;
			cout<<d.front().first<<" "<<time<<endl;
			d.pop();
		}
		else{
			time+=q;
			d.push(P(d.front().first,d.front().second-q));
			d.pop();
		}
		
	}
	return 0;
}

Compiler output:
a.cc:9:11: error: 'int time' redeclared as different kind of entity
    9 | int n,q,t,time;
      |           ^~~~
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'int main()':
a.cc:20:29: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   20 |                         time+=d.front().second;
      |                         ~~~~^~~~~~~~~~~~~~~~~~
a.cc:20:29: error: assignment of read-only location 'time'
a.cc:25:29: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   25 |                         time+=q;
      |                         ~~~~^~~
a.cc:25:29: error: assignment of read-only location 'time'
Language: C++

#include <cstdio>
#include <string>

using namespace std;

struct Process {
public:
    char name[10];
    int time;
};

class Queue {
public:
    Process* data;
    int first = 0;
    int last = 0;
    int max;

    Queue(int max) : max(max) {
        data = new Process[max];
    }

    void enqueue(Process p) {
        data[last] = p;

        if (last + 1 >= max) {
            last = 0;
        } else {
            last++;
        }
    }

    Process dequeue() {
        Process p = data[first];

        if (first + 1 >= max) {
            first = 0;
        } else {
            first++;
        }

        return p;
    }
};

int main() {
    int n;
    scanf("%d", &n);

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

    int t = 0;

    Queue queue(n);
    for (int i = 0; i < n; i++) {
        Process p;

        char name[10];
        scanf("%s", name);
        int time;
        scanf("%d", &time);

        strcpy(p.name, name);
        p.time = time;

        queue.enqueue(p);
    }

    while (true) {
        if (queue.data[queue.first].time > q) {
            t += q;
            queue.data[queue.first].time -= q;
            Process p = queue.dequeue();
            queue.enqueue(p);
        } else {
            t += queue.data[queue.first].time;
            queue.data[queue.first].time = 0;

            printf("%s %d\n", queue.data[queue.first].name, t);

            queue.dequeue();
        }

        if (queue.data[queue.first].time == 0) {
            break;
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:9: error: 'strcpy' was not declared in this scope
   64 |         strcpy(p.name, name);
      |         ^~~~~~
a.cc:3:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 |
Language: C++

#include <cstdio>
#include <string>

using namespace std;

struct Process {
public:
    char n[10];
    int t;
};

class Queue {
public:
    Process data[100005];
    int head;
    int tail;
    int max = 100005;

    void enqueue(Process p) {
        data[tail] = p;

        if (tail + 1 >= max) {
            tail = 0;
        } else {
            tail++;
        }
    }

    Process dequeue() {
        Process p = data[head];

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

        return p;
    }
};

int main() {
    int n;
    scanf("%d", &n);

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

    int elaps = 0;

    Queue queue;
    for (int i = 0; i < n; i++) {
        Process p;

        char name[10];
        scanf("%s", name);
        int t;
        scanf("%d", &t);

        strcpy(p.n, name);
        p.t = t;

        queue.enqueue(p);
    }
    queue.head = 0;
    queue.tail = n;

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:9: error: 'strcpy' was not declared in this scope
   60 |         strcpy(p.n, name);
      |         ^~~~~~
a.cc:3:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 |
Language: C++

#include <cstdint>

using namespace std;

#define ARRAY_SIZE 100000
process_t processes[ARRAY_SIZE];
uint32_t head, tail;

bool queue_dequeue(process_t &process)
{
  if (head == tail) return false;
  process = processes[head];
  head++;
  head %= ARRAY_SIZE;
  return true;
}

void queue_enqueue(process_t process)
{
  processes[tail] = process;
  tail++;
  tail %= ARRAY_SIZE;
}

bool queue_empty()
{
  if (head == tail)
    return true;
  else
    return false;
}

#if !defined(TEST)
#include <iostream>

int32_t main()
{
  uint32_t num, quantum;
  cin >> num >> quantum;

  for (uint32_t i = 0; i < num; i++) {
    string name;
    uint32_t time;
    cin >> name >> time;
    process_t process = {.name = name, .time = time};
    queue_enqueue(process);
  }

  uint32_t time = 0;
  while (!queue_empty()) {
    process_t process;
    queue_dequeue(process);
    uint32_t process_time = min(process.time, quantum);
    process.time -= process_time;
    time += process_time;
    if (process.time) {
      queue_enqueue(process);
    } else {
      cout << process.name << ' ' << time << endl;
    }
  }

  return 0;
}
#endif

Compiler output:
a.cc:6:1: error: 'process_t' does not name a type
    6 | process_t processes[ARRAY_SIZE];
      | ^~~~~~~~~
a.cc:9:20: error: 'process_t' was not declared in this scope
    9 | bool queue_dequeue(process_t &process)
      |                    ^~~~~~~~~
a.cc:9:31: error: 'process' was not declared in this scope
    9 | bool queue_dequeue(process_t &process)
      |                               ^~~~~~~
a.cc:18:6: error: variable or field 'queue_enqueue' declared void
   18 | void queue_enqueue(process_t process)
      |      ^~~~~~~~~~~~~
a.cc:18:20: error: 'process_t' was not declared in this scope
   18 | void queue_enqueue(process_t process)
      |                    ^~~~~~~~~
a.cc: In function 'int32_t main()':
a.cc:45:5: error: 'process_t' was not declared in this scope
   45 |     process_t process = {.name = name, .time = time};
      |     ^~~~~~~~~
a.cc:46:19: error: 'process' was not declared in this scope
   46 |     queue_enqueue(process);
      |                   ^~~~~~~
a.cc:46:5: error: 'queue_enqueue' was not declared in this scope; did you mean 'queue_dequeue'?
   46 |     queue_enqueue(process);
      |     ^~~~~~~~~~~~~
      |     queue_dequeue
a.cc:51:5: error: 'process_t' was not declared in this scope
   51 |     process_t process;
      |     ^~~~~~~~~
a.cc:52:19: error: 'process' was not declared in this scope
   52 |     queue_dequeue(process);
      |                   ^~~~~~~
a.cc:52:26: error: 'queue_dequeue' cannot be used as a function
   52 |     queue_dequeue(process);
      |                          ^
a.cc:57:7: error: 'queue_enqueue' was not declared in this scope; did you mean 'queue_dequeue'?
   57 |       queue_enqueue(process);
      |       ^~~~~~~~~~~~~
      |       queue_dequeue
Language: C++

#include <cstdint>
struct process_t {
  string name;
  uint32_t time;
  bool operator==(const process_t &p1) const
  {
    return (p1.name == this->name) && (p1.time == this->time);
  }
};

using namespace std;

#define ARRAY_SIZE 100000
process_t processes[ARRAY_SIZE];
uint32_t head, tail;

bool queue_dequeue(process_t &process)
{
  if (head == tail) return false;
  process = processes[head];
  head++;
  head %= ARRAY_SIZE;
  return true;
}

void queue_enqueue(process_t process)
{
  processes[tail] = process;
  tail++;
  tail %= ARRAY_SIZE;
}

bool queue_empty()
{
  if (head == tail)
    return true;
  else
    return false;
}

#if !defined(TEST)
#include <iostream>

int32_t main()
{
  uint32_t num, quantum;
  cin >> num >> quantum;

  for (uint32_t i = 0; i < num; i++) {
    string name;
    uint32_t time;
    cin >> name >> time;
    process_t process = {.name = name, .time = time};
    queue_enqueue(process);
  }

  uint32_t time = 0;
  while (!queue_empty()) {
    process_t process;
    queue_dequeue(process);
    uint32_t process_time = min(process.time, quantum);
    process.time -= process_time;
    time += process_time;
    if (process.time) {
      queue_enqueue(process);
    } else {
      cout << process.name << ' ' << time << endl;
    }
  }

  return 0;
}
#endif

Compiler output:
a.cc:3:3: error: 'string' does not name a type; did you mean 'stdin'?
    3 |   string name;
      |   ^~~~~~
      |   stdin
a.cc: In member function 'bool process_t::operator==(const process_t&) const':
a.cc:7:16: error: 'const struct process_t' has no member named 'name'
    7 |     return (p1.name == this->name) && (p1.time == this->time);
      |                ^~~~
a.cc:7:30: error: 'const struct process_t' has no member named 'name'
    7 |     return (p1.name == this->name) && (p1.time == this->time);
      |                              ^~~~
a.cc: In function 'int32_t main()':
a.cc:53:52: error: 'process_t' has no non-static data member named 'name'
   53 |     process_t process = {.name = name, .time = time};
      |                                                    ^
a.cc:67:23: error: 'struct process_t' has no member named 'name'
   67 |       cout << process.name << ' ' << time << endl;
      |                       ^~~~
Language: C++

#include <cstdint>
#include <string>

struct process_t {
  string name;
  uint32_t time;
  bool operator==(const process_t &p1) const
  {
    return (p1.name == this->name) && (p1.time == this->time);
  }
};

using namespace std;

#define ARRAY_SIZE 100000
process_t processes[ARRAY_SIZE];
uint32_t head, tail;

bool queue_dequeue(process_t &process)
{
  if (head == tail) return false;
  process = processes[head];
  head++;
  head %= ARRAY_SIZE;
  return true;
}

void queue_enqueue(process_t process)
{
  processes[tail] = process;
  tail++;
  tail %= ARRAY_SIZE;
}

bool queue_empty()
{
  if (head == tail)
    return true;
  else
    return false;
}

#if !defined(TEST)
#include <iostream>

int32_t main()
{
  uint32_t num, quantum;
  cin >> num >> quantum;

  for (uint32_t i = 0; i < num; i++) {
    string name;
    uint32_t time;
    cin >> name >> time;
    process_t process = {.name = name, .time = time};
    queue_enqueue(process);
  }

  uint32_t time = 0;
  while (!queue_empty()) {
    process_t process;
    queue_dequeue(process);
    uint32_t process_time = min(process.time, quantum);
    process.time -= process_time;
    time += process_time;
    if (process.time) {
      queue_enqueue(process);
    } else {
      cout << process.name << ' ' << time << endl;
    }
  }

  return 0;
}
#endif

Compiler output:
a.cc:5:3: error: 'string' does not name a type; did you mean 'stdin'?
    5 |   string name;
      |   ^~~~~~
      |   stdin
a.cc: In member function 'bool process_t::operator==(const process_t&) const':
a.cc:9:16: error: 'const struct process_t' has no member named 'name'
    9 |     return (p1.name == this->name) && (p1.time == this->time);
      |                ^~~~
a.cc:9:30: error: 'const struct process_t' has no member named 'name'
    9 |     return (p1.name == this->name) && (p1.time == this->time);
      |                              ^~~~
a.cc: In function 'int32_t main()':
a.cc:55:52: error: 'process_t' has no non-static data member named 'name'
   55 |     process_t process = {.name = name, .time = time};
      |                                                    ^
a.cc:69:23: error: 'struct process_t' has no member named 'name'
   69 |       cout << process.name << ' ' << time << endl;
      |                       ^~~~
Language: C++

#include<iostream>

#include<string.h>
using namespace std;
#define MAX 100005

struct Proc { 
	char name[200];
	int t;
};

int head, tail;
Proc Q[MAX];

bool IsEnpty(void) {
	return head == tail;
}

bool IsFull(void) {
	return head == (tail + 1) % MAX;
}

void enq(Proc y) {
	Q[tail] = y;
	tail = (tail + 1) % MAX;
}

Proc deq(void) {
	Proc x = Q[head];
	head = (head + 1) % MAX;
	return x;
}

int main(void) {
	int n, q;
	head = 0;
	tail = 0;
	int sumtime = 0;
	Proc proc[MAX];
	Proc aaa;

	cin >> n >> q;
	for (int i = 1; i <= n; i++) {
		cin >> proc[i].name >> proc[i].t;
		enq(proc[i]);
	}

	while (IsEnpty == FALSE) {
		aaa = deq();
		if (aaa.t - q <= 0) {
			sumtime += aaa.t;
			cout << aaa.name << sumtime << endl;
		}
		else {
			sumtime += q;
			aaa.t -= q;
			enq(aaa);
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:27: error: 'FALSE' was not declared in this scope
   48 |         while (IsEnpty == FALSE) {
      |                           ^~~~~
Language: C++

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

typedef struct {
	int time;
	char name[11] = "\0";
	int fintime;
} PROCESS;

int main(void)
{	
	int n, q;
	cin >> n >> q;
	
	PROCESS *queue = new PROCESS[n];
	for (int i = 0; i < n; i++) {
		cin >> queue[i].name;
		cin >> queue[i].time;
	}
	
	int time = 0;
	int idx = 0;
	int cnt = 0;
	PROCESS **finorder = new *PROCESS[n];
	while (cnt < n) {
		if (queue[idx].time != 0) {
			if (queue[idx].time <= q) {
				time += queue[idx].time;
				queue[idx].time = 0;
				queue[idx].fintime = time;
				finorder[cnt] = &queue[idx];
				cnt++;
			} else {
				time += q;
				queue[idx].time -= q;
			}
		} 
		
		idx = (idx + 1) % n;
	}
	
	for (int j = 0; j < n; j++) {
		cout << finorder[j]->name << " ";
		cout << finorder[j]->fintime << endl;
	}
	
	delete[] queue;
	delete[] finorder;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:34: error: expected type-specifier before '*' token
   26 |         PROCESS **finorder = new *PROCESS[n];
      |                                  ^
a.cc:26:42: error: expected primary-expression before '[' token
   26 |         PROCESS **finorder = new *PROCESS[n];
      |                                          ^
Language: C++

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

typedef struct {
	int time;
	char name[11] = "\0";
} PROCESS;

int main(void)
{	
	int n, q;
	cin >> n >> q;
	
	PROCESS *queue = new PROCESS[n];
	for (int i = 0; i < n; i++) {
		cin >> queue[i].name;
		cin >> queue[i].time;
	}
	
	int time = 0;
	int idx = 0;
	int cnt = 0;
	while (cnt < n) {
		if (queue[idx].time != 0) {
			if (queue[idx].time <= q) {
				time += queue[idx].time;
				queue[idx].time = 0;
				finorder[cnt] = idx;
				cnt++;
				
				cout << queue[idx].name << " ";
				cout << time << endl;
			} else {
				time += q;
				queue[idx].time -= q;
			}
		}
		idx = (idx + 1) % n;
	}
	
	delete[] queue;
	delete[] finorder;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:33: error: 'finorder' was not declared in this scope
   30 |                                 finorder[cnt] = idx;
      |                                 ^~~~~~~~
a.cc:44:18: error: 'finorder' was not declared in this scope
   44 |         delete[] finorder;
      |                  ^~~~~~~~
Language: C++

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

typedef struct {
	char name[11] = "\0";
	int time;
} P;

class Queue {
private:
	int size;
	P *queue;
	int head = 0;
	int tail = 0;
public:
	Queue(int n);
	void enqueue(P p);
	void dequeue();
	bool isEmpty();
	P *get();
	void clear()
}

Queue::Queue(int n)
{
	size = n;
	queue = new P[n];
}

void Queue::enqueue(P p)
{
	queue[tail] = p;
	tail = (tail + 1) % size;
}

void Queue::dequeue()
{
	head = (head + 1) % size;
}

bool Queue::isEmpty()
{
	return head == tail;
}

P *Queue::get()
{
	return &queue[head];
}

void Queue::clear()
{
	delete[] queue;
}

int main(void)
{	
	int n, q;
	cin >> n >> q;
	
	Queue queue(n);
	for (int i = 0; i < n; i++) {
		P p;
		cin >> p.name;
		cin >> p.time;
		queue.enqueue(p);
	}
	
	int time = 0;
	while (!queue.isEmpty()) {
		P *p = queue.get();
		if (p->time <= q) {
			time += p->time;
			queue.dequeue();
			cout << p->name << " ";
			cout << time << endl;
		} else {
			time += q;
			p->time -= q;
			queue.dequeue();
			queue.enqueue(p);
		}
	}
	
	queue.clear();
	return 0;
}

Compiler output:
a.cc:23:20: error: expected ';' at end of member declaration
   23 |         void clear()
      |                    ^
      |                     ;
a.cc:11:1: error: new types may not be defined in a return type
   11 | class Queue {
      | ^~~~~
a.cc:11:1: note: (perhaps a semicolon is missing after the definition of 'Queue')
a.cc:11:1: error: return type specification for constructor invalid
a.cc: In function 'int main()':
a.cc:83:39: error: cannot convert 'P*' to 'P'
   83 |                         queue.enqueue(p);
      |                                       ^
      |                                       |
      |                                       P*
a.cc:32:23: note:   initializing argument 1 of 'void Queue::enqueue(P)'
   32 | void Queue::enqueue(P p)
      |                     ~~^