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

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


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

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

void enqueue(P x){
Q[tail]=x;
tail=(tail+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)
else{
printf("%s %d\n,u.name,elaps):
}
}
return 0;
}

Compiler output:
a.cc:41:8: warning: missing terminating " character
   41 | printf("%s %d\n,u.name,elaps):
      |        ^
a.cc:41:8: error: missing terminating " character
   41 | printf("%s %d\n,u.name,elaps):
      |        ^~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'void enqueue(P)':
a.cc:17:8: error: return-statement with a value, in function returning 'void' [-fpermissive]
   17 | return x;
      |        ^
a.cc: In function 'int main()':
a.cc:35:3: error: 'dequeue' was not declared in this scope; did you mean 'enqueue'?
   35 | u=dequeue();
      |   ^~~~~~~
      |   enqueue
a.cc:40:1: error: expected primary-expression before 'else'
   40 | else{
      | ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

queue<pair<string,int> > Q;
int n;
int quantum;
int main(){
	int n;
	cin >> n >> quantum;
	REP(i,n){
		string tmpstr;
		int tmptime;
		cin >> tmpstr >> tmptime;
		Q.push(make_pair(tmpstr,tmptime));
	}
	ll int nowtime = 0;
	while(!Q.empty()){
		int tmp = Q.front.second;
		if(tmp<=quantum){
			nowtime+=tmp;
			cout << Q.front.first << " " << nowtime << endl;
			Q.pop();
		}else{
			Q.push(make_pair(Q.front.first,tmp-quantum));
			Q.pop();
		}
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:29: error: invalid use of member function 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >::front' (did you forget the '()' ?)
   37 |                 int tmp = Q.front.second;
      |                           ~~^~~~~
a.cc:40:35: error: invalid use of member function 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >::front' (did you forget the '()' ?)
   40 |                         cout << Q.front.first << " " << nowtime << endl;
      |                                 ~~^~~~~
a.cc:43:44: error: invalid use of member function 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >::front' (did you forget the '()' ?)
   43 |                         Q.push(make_pair(Q.front.first,tmp-quantum));
      |                                          ~~^~~~~
Language: C++

#include <cstdio>

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

QUEUE q[100000];
int head, tail;

void enqueue(char *name, int time){
	int len = strlen(name);
	for(int i = 0; i < len; i++){
		q[tail].name[i] = name[i];
	}
	q[tail].time = time;
	tail = (tail+1) % 100000;
}

QUEUE *dequeue(){
	head = (head + 1) % 100000;
	if(head == 0){
		return &q[99999];
	}
	return &q[head-1];
}

int main(){
	int n, q;
	char name[10];
	int time;
	QUEUE *queue;
	
	scanf("%d %d", &n, &q);
	for(int i = 0; i < n; i++){
		scanf("%s %d", name, &time);
		enqueue(name, time);
	}
	time = 0;
	while(tail != head){
		queue = dequeue();
		queue->time -= q;
		time += q;
		if(queue->time <= 0){
			time += queue->time;
			printf("%s %d\n", queue->name, time);
		}else {
			enqueue(queue->name, queue->time);
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'void enqueue(char*, int)':
a.cc:12:19: error: 'strlen' was not declared in this scope
   12 |         int len = strlen(name);
      |                   ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <cstdio>
  +++ |+#include <cstring>
    2 |
Language: C++

//できるだけ単純に実装する
//c++での文字列の扱い方も難しい．
//c++でも文字列を扱うときはchar[]を使った方がなにをやってるか
//明確になるのでバグも減るかも
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <vector>
#include <string>
#define LEN 100005
using namespace std;

//new演算子の役割は動的確保を行うこと

/*通常のキュー
class Queue{
private:
	vector<string> s_v;
	vector<int> t_v;
public:
	//void enqueue(string s,int t);
	//string dequeue_name();
	//int dequeue_time();
	//bool isEmpty();
	//bool isFull();


	void enqueue(string s,int t){
	s_v.push_back(s);
	t_v.push_back(t);
	}

	string dequeue_name(){
		string tmp;
		tmp = *s_v.begin();
		s_v.erase(s_v.begin());
		return tmp;
	}

	int dequeue_time(){
		int tmp;
		tmp = *t_v.begin();
		t_v.erase(t_v.begin());
		return tmp;
	}

	bool isEmpty(){
		return s_v.empty();
	}
};
*/
class process{
public:
	string name;
	int time_wanted;

	process(string s,int t){
		name = s;
		time_wanted = t;
	}
};
/*リングバッファ*/
class Queue{
private:
	process *prcsQ[LEN];
	int top;
	int tail;
public:

	Queue(){
		this->top=0;
		this->tail=1;
	}

	void first_enqueue(process *p){
		prcsQ[0] = p;
	}
	
	void enqueue(process *p){
		prcsQ[tail] = p;
		tail = (tail + 1) % LEN;
		//cout <<tail <<endl;
	}

	process * dequeue(){
		int oldtop = top;
		top = (top + 1) % LEN;
		//cout <<top <<endl;
		return prcsQ[oldtop];
	}

	bool isEmpty(){
		if(top == tail)
			return true;
		return false;
	}
};

int main(){
	int process_num;
	int qwantum;
	string tmp_name;
	int tmp_time;
	int current_time = 0;
	char tmp_charsq[100];


	scanf("%d%d",&process_num,&qwantum);//scanfの用法

	Queue queue;

	for(int i=0;i<process_num;i++){
		scanf("%s%d",tmp_charsq,&tmp_time);
		//まずCでサポートされているchar[]に代入し，char[]をstringに代入するという形式にする
		tmp_name = tmp_charsq;
		process *p = new process(tmp_name,tmp_time);
		if(i==0)
			queue.first_enqueue(p);
		else
			queue.enqueue(p);
	}
	
	for(while true){
		process *alt;
		alt = queue.dequeue();
		if(alt->time_wanted <= qwantum){
			current_time = current_time + alt->time_wanted;
			cout <<alt->name <<" " <<current_time << endl;
			delete alt;
			if(queue.isEmpty())
				return 0;
		}else{
			current_time = current_time + qwantum;
			alt->time_wanted = alt->time_wanted - qwantum;
			queue.enqueue(alt);
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:123:13: error: expected primary-expression before 'while'
  123 |         for(while true){
      |             ^~~~~
a.cc:139:9: error: expected primary-expression before 'return'
  139 |         return 0;
      |         ^~~~~~
a.cc:137:10: error: expected ';' before 'return'
  137 |         }
      |          ^
      |          ;
  138 | 
  139 |         return 0;
      |         ~~~~~~
a.cc:139:9: error: expected primary-expression before 'return'
  139 |         return 0;
      |         ^~~~~~
a.cc:137:10: error: expected ')' before 'return'
  137 |         }
      |          ^
      |          )
  138 | 
  139 |         return 0;
      |         ~~~~~~
a.cc:123:12: note: to match this '('
  123 |         for(while true){
      |            ^
Language: C++

#include<string>
#include<iostream>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<queue>
#include<algorithm>

using namespace std;

struct PAIR {
    string   first;
    int second;
};

int main(){
	int number;
	scanf("%d",&number);
	int qu;
	scanf("%d",&qu);
	queue<PAIR> Q;
	
	string name; 
	int t;
	for(int i=0;i<number;i++){
		cin >> name >> t;
		PAIR d;
		d.first=name;
		d.second=t;
		Q.push(d);
		}
	
	int time=0;
	while(!Q.empty()){
		if(Q.front().second<=100) {
			PAIR c=Q.front();
			Q.pop();
			int elapse=c.seond+time
			cout <<c.first<<" "<< elapse << endl;
			time+=c.second;
		}
		else{
			PAIR c=Q.front();
			Q.pop();
			c.second-=100;
			Q.push(c);
			time += 100;
			}
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:38: error: 'struct PAIR' has no member named 'seond'; did you mean 'second'?
   38 |                         int elapse=c.seond+time
      |                                      ^~~~~
      |                                      second
Language: C++

#include<string>
#include<iostream>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<queue>
#include<algorithm>

using namespace std;

struct PAIR {
    string   first;
    int second;
};

int main(){
	int number;
	scanf("%d",&number);
	int qu;
	scanf("%d",&qu);
	queue<PAIR> Q;
	
	string name; 
	int t;
	for(int i=0;i<number;i++){
		cin >> name >> t;
		PAIR d;
		d.first=name;
		d.second=t;
		Q.push(d);
		}
	
	int time=0;
	while(!Q.empty()){
		if(Q.front().second<=100) {
			PAIR c=Q.front();
			Q.pop();
			int elapse=c.second+time
			cout <<c.first<<" "<< elapse << endl;
			time+=c.second;
		}
		else{
			PAIR c=Q.front();
			Q.pop();
			c.second-=100;
			Q.push(c);
			time += 100;
			}
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:25: error: expected ',' or ';' before 'cout'
   39 |                         cout <<c.first<<" "<< elapse << endl;
      |                         ^~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

struct Process {
  string name;
  int time;
};

const int LEN = 100005;
Process p_queue[LEN];
int head, tail, n;

void enqueue(Process p) {
  p_queue[tail] = p;
  tail = (tail + 1 ) % LEN;
}

Process dequeue() {
  Process p = p_queue[head];
  head = (head + 1) % LEN;
  return p;
}

int main() {
  int i, q;
  int total_time = 0, i;
  Process u;

  cin >> n;
  cin >> q;

  for (int i = 1; i <= n; i++) {
    string name;
    cin >> name;
    int time;
    cin >> time;

    p_queue[i].name = name;
    p_queue[i].time = time;
  }
  head = 1;
  tail = n + 1;

  while (head != tail) {
    u = dequeue();
    c = min(q, u.t);
    u.t -= c;
    total_time += c;
    if (u.t > 0) {
      enqueue(u);
    } else {
      cout << u.name << " " << total_time << endl;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:23: error: redeclaration of 'int i'
   28 |   int total_time = 0, i;
      |                       ^
a.cc:27:7: note: 'int i' previously declared here
   27 |   int i, q;
      |       ^
a.cc:48:5: error: 'c' was not declared in this scope
   48 |     c = min(q, u.t);
      |     ^
a.cc:48:18: error: 'struct Process' has no member named 't'
   48 |     c = min(q, u.t);
      |                  ^
a.cc:49:7: error: 'struct Process' has no member named 't'
   49 |     u.t -= c;
      |       ^
a.cc:51:11: error: 'struct Process' has no member named 't'
   51 |     if (u.t > 0) {
      |           ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

struct Process {
  string name;
  int time;
};

const int LEN = 100005;
Process p_queue[LEN];
int head, tail, n;

void enqueue(Process p) {
  p_queue[tail] = p;
  tail = (tail + 1 ) % LEN;
}

Process dequeue() {
  Process p = p_queue[head];
  head = (head + 1) % LEN;
  return p;
}

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

int main() {
  int q;
  int total_time = 0, i;
  Process u;

  cin >> n;
  cin >> q;

  for (int i = 1; i <= n; i++) {
    string name;
    cin >> name;
    int time;
    cin >> time;

    p_queue[i].name = name;
    p_queue[i].time = time;
  }
  head = 1;
  tail = n + 1;

  while (head != tail) {
    u = dequeue();
    c = min(q, u.t);
    u.t -= c;
    total_time += c;
    if (u.t > 0) {
      enqueue(u);
    } else {
      cout << u.name << " " << total_time << endl;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:5: error: 'c' was not declared in this scope
   52 |     c = min(q, u.t);
      |     ^
a.cc:52:18: error: 'struct Process' has no member named 't'
   52 |     c = min(q, u.t);
      |                  ^
a.cc:53:7: error: 'struct Process' has no member named 't'
   53 |     u.t -= c;
      |       ^
a.cc:55:11: error: 'struct Process' has no member named 't'
   55 |     if (u.t > 0) {
      |           ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

struct Process {
  string name;
  int time;
};

const int LEN = 100005;
Process p_queue[LEN];
int head, tail, n;

void enqueue(Process p) {
  p_queue[tail] = p;
  tail = (tail + 1 ) % LEN;
}

Process dequeue() {
  Process p = p_queue[head];
  head = (head + 1) % LEN;
  return p;
}

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

int main() {
  int q;
  int total_time = 0, c;
  Process u;

  cin >> n;
  cin >> q;

  for (int i = 1; i <= n; i++) {
    string name;
    cin >> name;
    int time;
    cin >> time;

    p_queue[i].name = name;
    p_queue[i].time = time;
  }
  head = 1;
  tail = n + 1;

  while (head != tail) {
    u = dequeue();
    c = min(q, u.t);
    u.t -= c;
    total_time += c;
    if (u.t > 0) {
      enqueue(u);
    } else {
      cout << u.name << " " << total_time << endl;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:18: error: 'struct Process' has no member named 't'
   52 |     c = min(q, u.t);
      |                  ^
a.cc:53:7: error: 'struct Process' has no member named 't'
   53 |     u.t -= c;
      |       ^
a.cc:55:11: error: 'struct Process' has no member named 't'
   55 |     if (u.t > 0) {
      |           ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

struct Process {
  string name;
  int t;
};

const int LEN = 100005;
Process p_queue[LEN];
int head, tail, n;

void enqueue(Process p) {
  p_queue[tail] = p;
  tail = (tail + 1 ) % LEN;
}

Process dequeue() {
  Process p = p_queue[head];
  head = (head + 1) % LEN;
  return p;
}

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

int main() {
  int q;
  int total_time = 0, c;
  Process u;

  cin >> n;
  cin >> q;

  for (int i = 1; i <= n; i++) {
    string name;
    cin >> name;
    int time;
    cin >> time;

    p_queue[i].name = name;
    p_queue[i].time = time;
  }
  head = 1;
  tail = n + 1;

  while (head != tail) {
    u = dequeue();
    c = min(q, u.t);
    u.t -= c;
    total_time += c;
    if (u.t > 0) {
      enqueue(u);
    } else {
      cout << u.name << " " << total_time << endl;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:16: error: 'struct Process' has no member named 'time'
   45 |     p_queue[i].time = time;
      |                ^~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()
{
	cin.tie(0);
	ios::ios_base::sync_with_stdio(false);
	int taskam, q, time = 0;
	cin >> taskam >> q;
	for (int i = 0; i < taskam; ++i) {
		string name;
		int thistask;
		cin >> name >> thistask;
		if (thistask <= q) {
			time += thistask;
			cout << name << " " << time << endl;
			continue;
		}
		tasks.emplace(make_pair(name, thistask-q));
	}
	while (!tasks.empty()) {
		int tmpt = tasks.front().second;
		string tmpname = tasks.front().first;
		tasks.pop();
		int n = tmpt - q;
		if (n > 0) {
			tasks.emplace(make_pair(tmpname, n));
			time += q;
		}
		else {
			time += tmpt;
			cout << tmpname << " " << time << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'tasks' was not declared in this scope; did you mean 'taskam'?
   20 |                 tasks.emplace(make_pair(name, thistask-q));
      |                 ^~~~~
      |                 taskam
a.cc:22:17: error: 'tasks' was not declared in this scope; did you mean 'taskam'?
   22 |         while (!tasks.empty()) {
      |                 ^~~~~
      |                 taskam
Language: C++

#include<iostream>
#include<string>
#include<utility>
#include<algorithm>
#include<queue>

using namespace std;

int main()
{
	cin.tie(0);
	ios::ios_base::sync_with_stdio(false);
	int taskam, q, time = 0;
	cin >> taskam >> q;
	for (int i = 0; i < taskam; ++i) {
		string name;
		int thistask;
		cin >> name >> thistask;
		if (thistask <= q) {
			time += thistask;
			cout << name << " " << time << endl;
			continue;
		}
		tasks.emplace(make_pair(name, thistask-q));
	}
	while (!tasks.empty()) {
		int tmpt = tasks.front().second;
		string tmpname = tasks.front().first;
		tasks.pop();
		int n = tmpt - q;
		if (n > 0) {
			tasks.emplace(make_pair(tmpname, n));
			time += q;
		}
		else {
			time += tmpt;
			cout << tmpname << " " << time << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'tasks' was not declared in this scope; did you mean 'taskam'?
   24 |                 tasks.emplace(make_pair(name, thistask-q));
      |                 ^~~~~
      |                 taskam
a.cc:26:17: error: 'tasks' was not declared in this scope; did you mean 'taskam'?
   26 |         while (!tasks.empty()) {
      |                 ^~~~~
      |                 taskam
Language: C++


	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int p = sc.nextInt();
		
		ArrayList<Process> ar = new ArrayList<Process>();
		ArrayList<Process> result = new ArrayList<Process>();
		
		for (int i = 0; i < n; i++) {
			ar.add(new Process(sc.next(),sc.nextInt()));
		}
		
		int totalTime=0,i=0;
		Process process;
		while(true){
			if(i<n){
				if((process=ar.get(i)).getTime()<=p){
					totalTime += process.getTime();
					result.add(new Process(process.getName(), totalTime));
					ar.remove(i);
					n--;
				}
				else{
					totalTime += p;
					int temp =ar.get(i).getTime()-p;
					ar.get(i).setTime(temp);
					i++;
				}
			}
			else{
				i=0;
			}
			if(ar.size()==0){
				break;
			}
		}
		
		for(Process rProcess:result){
			System.out.println(rProcess.getName()+ " "+rProcess.getTime());
		}
		
	}
	

Compiler output:
a.cc:3:9: error: expected unqualified-id before 'public'
    3 |         public static void main(String[] args) {
      |         ^~~~~~
Language: C++

N_str, q_str = raw_input().spilit()
N = int(N_str)
q = int (q_str)
A =[]
B =[]
total =0

for i in N:
    t = raw_input().spilit()
    A.append(t[0],int(t[1]))

while A:
    name, time = A.pop(0)
    if time < q:
        total += time
        B.append(name, time)
       
    else:
        time -= q
        total += q
        A.append(name, time)

print " ".join()

Compiler output:
a.cc:1:1: error: 'N_str' does not name a type
    1 | N_str, q_str = raw_input().spilit()
      | ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <queue>


int main(){
	int n, q;
	std::queue<std::pair<std::string, int> >qu;
	std::string name;
	int num, sum = 0;


	std::cin >> n >> q;

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

		std::cin >> name >> num;

		if (num <= q){
			sum += num;
			std::cout << name << " " << sum << std::endl;
		}
		else if (num > q){

			sum += q;
			qu.push(make_pair(name, num - q));
		}
	}
	while (!qu.empty()){
		std::pair<std::string, int>p = qu.front(); qu.pop;

		if (p.second <= q){
			sum += p.second;
			std::cout << p.first << " " << sum << std::endl;
		}
		else if (p.second > q){
			sum += q;
			qu.push(make_pair(p.first, p.second - q));
		}
	}


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:63: error: invalid use of non-static member function 'void std::queue<_Tp, _Sequence>::pop() [with _Tp = std::pair<std::__cxx11::basic_string<char>, int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, int> > >]'
   31 |                 std::pair<std::string, int>p = qu.front(); qu.pop;
      |                                                            ~~~^~~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_queue.h:316:7: note: declared here
  316 |       pop()
      |       ^~~
Language: C++

#include <queue>
#include <utility>
#include <string>
#include <iostream>

using namespace std;

int main(){
    pair<string, int> schedule;
    queue<pair <string, int> > Q;
    int total;
    int n,q;
    cin >> n >> q;
    for(int i=0;i<n;i++){
        string s;
        int ms;
        cin >> s >> ms;
        schedule = make_pair(s, ms);
        Q.push(schedule);
    }
    while(!Q.empty()){
        if(Q.front().second()<=q){
            total += Q.front().second();
            cout << Q.front().first() << " " << total << endl;
            Q.pop();
        }
        else{
            total += q;
            schedule = make_pair(Q.front().first(),Q.front().second()-q);
            Q.pop();
            Q.push(schedule);
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:28: error: expression cannot be used as a function
   22 |         if(Q.front().second()<=q){
      |            ~~~~~~~~~~~~~~~~^~
a.cc:23:38: error: expression cannot be used as a function
   23 |             total += Q.front().second();
      |                      ~~~~~~~~~~~~~~~~^~
a.cc:24:36: error: no match for call to '(std::__cxx11::basic_string<char>) ()'
   24 |             cout << Q.front().first() << " " << total << endl;
      |                     ~~~~~~~~~~~~~~~^~
a.cc:29:49: error: no match for call to '(std::__cxx11::basic_string<char>) ()'
   29 |             schedule = make_pair(Q.front().first(),Q.front().second()-q);
      |                                  ~~~~~~~~~~~~~~~^~
a.cc:29:68: error: expression cannot be used as a function
   29 |             schedule = make_pair(Q.front().first(),Q.front().second()-q);
      |                                                    ~~~~~~~~~~~~~~~~^~
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()
 
#define REP(i,s,e)	for(int i=(s); i<(e); i++)
#define rep(i,n)	REP(i,0,n)
#define REPE(i,s,e)	for(int i=s; i>e; i--)
#define repe(i,n)	REPE(i,n,-1)


typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<vi> vvi;
 
const int IMAX=((1<<30)-1)*2+1;
const int INF=100000000;
const double EPS=1e-10;
//int mod=1000000007
 
int main(){
	int n, q;
	cin>>n>>q;
	queue<pair<int,string> > que;
	string s; int m;
	rep(i, n){
		cin>>s>>m;
		que.push(pair<int,string>(m, s));
	}
	int t = 0;
	pair<int,string> p;
	while(!que.empty()){
		p = que.front();
		que.push();
		if(p.fi - q > 0) {
			que.push(pair<int,string>(p.fi - q, p.se));
			t += q;
			cout<<p.se<<" "<<t<<endl;

		}
		else t += p.fi;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:25: error: no matching function for call to 'std::queue<std::pair<int, std::__cxx11::basic_string<char> > >::push()'
   57 |                 que.push();
      |                 ~~~~~~~~^~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:15:
/usr/include/c++/14/bits/stl_queue.h:283:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<int, std::__cxx11::basic_string<char> >; _Sequence = std::deque<std::pair<int, std::__cxx11::basic_string<char> >, std::allocator<std::pair<int, std::__cxx11::basic_string<char> > > >; value_type = std::pair<int, std::__cxx11::basic_string<char> >]'
  283 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:283:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_queue.h:288:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(value_type&&) [with _Tp = std::pair<int, std::__cxx11::basic_string<char> >; _Sequence = std::deque<std::pair<int, std::__cxx11::basic_string<char> >, std::allocator<std::pair<int, std::__cxx11::basic_string<char> > > >; value_type = std::pair<int, std::__cxx11::basic_string<char> >]'
  288 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:288:7: note:   candidate expects 1 argument, 0 provided
Language: C++

#include <algorithm>
#include <iostream>
#include <fstream>
#include <cstdio>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cmath>
#include <functional>
#include <cassert>
#include <iomanip>
#include <array>
#include <time.h>
#include <limits.h>
#pragma comment(lib, "winmm.lib")
#define debug(x) cout<<#x<<": "<<x<<endl
#define rep(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<=(b);i++)


using namespace std;

class task{
public:
	string name;
	int time;
};

void CheckQueue(queue<task> Q){
	printf_s("check start---\n");
	int size = Q.size();
	rep(i, size){
		debug(Q.size());
		printf_s("%s %d\n", Q.front().name.c_str(), Q.front().time);
		Q.pop();
	}
	printf_s("check end---\n");
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef _WIN32
	istream &cin = ifstream("input.txt");
#endif

	queue<task> Q;
	int n, quantum, sum = 0;

	cin >> n >> quantum;
	string tmp1, tmp2;
	rep(i, n){
		cin >> tmp1 >> tmp2;
		Q.push({ tmp1, stoi(tmp2) });
	}
	while (!Q.empty()){
		if (Q.front().time <= quantum){
			
			sum += Q.front().time;
			cout << Q.front().name << " " << sum << endl;
			//printf_s("pop");
			//debug(Q.front().name);
			Q.pop();
		}
		else{
			//debug(Q.front().name);
			sum += quantum;
			//debug(sum);
			//printf_s("push");
			//debug(Q.front().name);
			string str = Q.front().name; int in = Q.front().time - quantum;
			Q.push({ str, in });
			//printf_s("pop");
			//debug(Q.front().name);
			Q.pop();
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'void CheckQueue(std::queue<task>)':
a.cc:31:9: error: 'printf_s' was not declared in this scope; did you mean 'printf'?
   31 |         printf_s("check start---\n");
      |         ^~~~~~~~
      |         printf
Language: C++

#include <algorithm>
#include <iostream>
#include <fstream>
#include <cstdio>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cmath>
#include <functional>
#include <cassert>
#include <iomanip>
#include <array>
#include <time.h>
#include <limits.h>
#pragma comment(lib, "winmm.lib")
#define debug(x) cout<<#x<<": "<<x<<endl
#define rep(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<=(b);i++)


using namespace std;

class task{
public:
	string name;
	int time;
};

void CheckQueue(queue<task> Q){
	printf_s("check start---\n");
	int size = Q.size();
	rep(i, size){
		debug(Q.size());
		printf_s("%s %d\n", Q.front().name.c_str(), Q.front().time);
		Q.pop();
	}
	printf_s("check end---\n");
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef _WIN32
	istream &cin = ifstream("input.txt");
#endif

	queue<task> Q;
	int n, quantum, sum = 0;

	cin >> n >> quantum;
	string tmp1, tmp2;
	rep(i, n){
		cin >> tmp1 >> tmp2;
		Q.push({ tmp1, stoi(tmp2) });
	}
	while (!Q.empty()){
		if (Q.front().time <= quantum){
			
			sum += Q.front().time;
			cout << Q.front().name << " " << sum << endl;
			//printf_s("pop");
			//debug(Q.front().name);
			Q.pop();
		}
		else{
			//debug(Q.front().name);
			sum += quantum;
			//debug(sum);
			//printf_s("push");
			//debug(Q.front().name);
			string str = Q.front().name; int in = Q.front().time - quantum;
			Q.push({ str, in });
			//printf_s("pop");
			//debug(Q.front().name);
			Q.pop();
		}
	}
	
	system("PAUSE");
	return 0;
}

Compiler output:
a.cc: In function 'void CheckQueue(std::queue<task>)':
a.cc:31:9: error: 'printf_s' was not declared in this scope; did you mean 'printf'?
   31 |         printf_s("check start---\n");
      |         ^~~~~~~~
      |         printf
Language: C++

import collections
n, q = map(int, input().split())
q_list = collections.deque()
for i in range(n):
    name, time = input().split()
    q_list.append([name, int(time)])

time = 0
while q_list:
    if q_list[0][1] == 0:
        q_list.popleft()
    elif q_list[0][1] == 100:
        time += 100
        print (q_list[0][0], time)
        q_list[0][1] = 0
        q_list.rotate(-1)
    elif q_list[0][1] < 100:
        time += q_list[0][1]
        q_list[0][1] = 0
        print (q_list[0][0], time)
        q_list.rotate(-1)
    else:
        q_list[0][1] -= 100
        time += 100
        q_list.rotate(-1)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import collections
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <string>
#include <queue>

using namespace std;

struct process {
    string name;
    int time;
};

int main()
{
    int n, q;
    int name, time, total = 0;
    process tmp;
    queue<process> qu;

    cin >> n >> q;

    for ( int i = 0; i < n; ++i ) {
        cin >> tmp.name >> tmp.time;
        qu.push(tmp);
    }

    while( 1 ) {
        tmp = qu.front();

        if ( tmp.time <= q ) {
            total += tmp.time;
            qu.pop();
            cout << tmp.name << " " <<  total << endl;
        } else {
            tmp.time -= q;
            total += q;
            qu.push(tmp);
            qu.pop();
        }

        if ( qu.empty() ) {
            break;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'cin' was not declared in this scope
   18 |     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 <queue>
  +++ |+#include <iostream>
    3 | 
a.cc:31:13: error: 'cout' was not declared in this scope
   31 |             cout << tmp.name << " " <<  total << endl;
      |             ^~~~
a.cc:31:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:50: error: 'endl' was not declared in this scope
   31 |             cout << tmp.name << " " <<  total << endl;
      |                                                  ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <queue>
  +++ |+#include <ostream>
    3 |
Language: C++

#include <iostream>
#include <queue>
#include <string>
using namespace std;
  
class Task {
public:
  void input() {
    cin >> name >> time;
  }
  string name;
  int time;
};
  
int main() {
  int n, q;
  queue<Task> tasks;
  
  cin >> n >> q;
  for (int i=0; i<n; i++) {
    auto task = Task();
    task.input();
    tasks.push(task);
  }
  
  int time = 0;
  
  while (!queue.empty) {
    auto currnt = queue.front(); queue.pop();
    if (current.time > q) {
      time += q;
      current.time -= q;
      queue.push(current);
    } else {
      time += current.time;
      cout << current.name << ' ' << time << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:16: error: missing template arguments before '.' token
   28 |   while (!queue.empty) {
      |                ^
a.cc:29:24: error: missing template arguments before '.' token
   29 |     auto currnt = queue.front(); queue.pop();
      |                        ^
a.cc:29:39: error: expected unqualified-id before '.' token
   29 |     auto currnt = queue.front(); queue.pop();
      |                                       ^
a.cc:30:9: error: 'current' was not declared in this scope
   30 |     if (current.time > q) {
      |         ^~~~~~~
a.cc:33:12: error: expected unqualified-id before '.' token
   33 |       queue.push(current);
      |            ^
Language: C++

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

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

const long LEN=100000;

class queue {
	process data[LEN];
	int head, tail;
public:
	queue(): head(0), tail(0) {}  //
	void enqueue(const process&);
	process dequeue();
	bool isEmpty();
	bool isFull();
};

void queue::enqueue(const process& p)
{
	if( this->isFull() ){
		cout<<"full!"<<endl;
		exit(1);
	}


	data[tail+1]=p;
	tail= (tail+1) % LEN;
}
process queue::dequeue()
{
	if( isEmpty() ){
		cout<<"empty!"<<endl;
		exit(1);
	}

	
	head= (head+1) % LEN;
	return data[head];
}
bool queue::isEmpty()
{
	return head == tail;
}
bool queue::isFull()
{
	return (tail+1) % LEN == head;
}

int main()
{
	queue q;


	int n, quan;
	cin>>n>>quan;

	process p;

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

		cin>>p.name>>p.time;

		q.enqueue(p);
	}

	int passTime=0;

	while( !q.isEmpty() ) {
		process t=q.dequeue();
		if( t.time - quan <=0 ){
			passTime+=t.time;
			cout<<t.name<<' '<<passTime<<endl;
		}else{
			passTime+=quan;
			t.time-=quan;
			q.enqueue(t);
		}


	}

}???

Compiler output:
a.cc:88:2: error: expected unqualified-id before '?' token
   88 | }???
      |  ^
Language: C++

#include <iostream>
#include <cstdio>
#define MAX 100000
using namespace std;

char name[MAX][10];
int task[MAX];
int quantum;	//ms
int n;
int time;

int main(void){
	int i;
	int count=0;	//?????§??£?¶?????????????????????????????????°
	int clock=0;

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

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

	while(count<=n){

		if(task[clock]<=0){
//			cout<<"process"<<name[clock]<<"have already finished."<<endl;
			++count;

		}else if(task[clock]<=quantum){
			time+=task[clock];
			task[clock]=0;
			cout<<name[clock]<<" "<<time<<endl;
			++count;
			
		}else{
			time+=quantum;
			task[clock]-=quantum;
			count=0;

		}

		++clock;

		if(clock>=n){
			clock=0;
//			cout<<"from beginning"<<endl;
		}


	}

//	???????????°??¨
//	cout<<"--------"<<endl;
//	for(i=0;i<n;i++){
//
//		cout<<name[i]<<" ";
//		cout<<task[i]<<endl;
//	}

	return 0;
}

Compiler output:
a.cc:10:5: error: 'int time' redeclared as different kind of entity
   10 | int 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:30:29: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |                         time+=task[clock];
      |                         ~~~~^~~~~~~~~~~~~
a.cc:30:29: error: assignment of read-only location 'time'
a.cc:36:29: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                         time+=quantum;
      |                         ~~~~^~~~~~~~~
a.cc:36:29: error: assignment of read-only location 'time'
Language: C++

#include <iostream>
#include <cstdlib>
#include <cmath>
#include <cstdio>
#include <string>
#include <stack>
#include <queue>
#include <stdlib.h>
#include <sstream>
using namespace std;
int n, m;
string p[100000];
int a[100000];
queue<int> q;
int c, s, t;
int u;
int main()
{
	cin >> n >> m;
	c=n;
	u=0;
	for(int i=0; i<n; i++)
	{
		cin >> p[i] >> a[i];
		q.push(i);
		q.push(a[i]);
	}
	while(c>0)
	{
		s=q.front();
		q.pop();
		t=q.front();
		q.pop();
		if(t>m)
		{
			t-=m;
			q.push(s);
			q.push(t);
			u+=m;
		}
		else
		{
			u+=t;
			cout << p[s] << " " << u << endl;
			c-=1;
		}
	}
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:48:18: error: expected '}' at end of input
   48 |         return 0;
      |                  ^
a.cc:18:1: note: to match this '{'
   18 | {
      | ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
pair<string,int> D[10000000];
int n,q,b[100000];string a[100000];
int main(){
	scanf("%d%d",&n,&q);
	int cnt=0,t=0;
	for(int i=0;i<n;i++){
		cin>>s[i]>>b[i];
		D[cnt]=make_pair(s[i],b[i]);cnt++;
	}
	for(int i=0;i<cnt;i++){
		if(D[i].second>q){
			t+=q;
			D[cnt]=make_pair(D[i].first,D[cnt]-q);
			cnt++;
		}
		else{
			t+=D[i].second;
			cout<<D[i].first<<' '<<t<<endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: 's' was not declared in this scope
   10 |                 cin>>s[i]>>b[i];
      |                      ^
a.cc:16:59: error: no match for 'operator-' (operand types are 'std::pair<std::__cxx11::basic_string<char>, int>' and 'int')
   16 |                         D[cnt]=make_pair(D[i].first,D[cnt]-q);
      |                                                     ~~~~~~^~
      |                                                          | |
      |                                                          | int
      |                                                          std::pair<std::__cxx11::basic_string<char>, int>
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:16:60: note:   'std::pair<std::__cxx11::basic_string<char>, int>' is not derived from 'const std::reverse_iterator<_Iterator>'
   16 |                         D[cnt]=make_pair(D[i].first,D[cnt]-q);
      |                                                            ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:16:60: note:   'std::pair<std::__cxx11::basic_string<char>, int>' is not derived from 'const std::move_iterator<_IteratorL>'
   16 |                         D[cnt]=make_pair(D[i].first,D[cnt]-q);
      |                                                            ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
pair<string,int> D[10000000];
int n,q,b[100000];string s[100000];
int main(){
	scanf("%d%d",&n,&q);
	int cnt=0,t=0;
	for(int i=0;i<n;i++){
		cin>>s[i]>>b[i];
		D[cnt]=make_pair(s[i],b[i]);cnt++;
	}
	for(int i=0;i<cnt;i++){
		if(D[i].second>q){
			t+=q;
			D[cnt]=make_pair(D[i].first,D[cnt]-q);
			cnt++;
		}
		else{
			t+=D[i].second;
			cout<<D[i].first<<' '<<t<<endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:59: error: no match for 'operator-' (operand types are 'std::pair<std::__cxx11::basic_string<char>, int>' and 'int')
   16 |                         D[cnt]=make_pair(D[i].first,D[cnt]-q);
      |                                                     ~~~~~~^~
      |                                                          | |
      |                                                          | int
      |                                                          std::pair<std::__cxx11::basic_string<char>, int>
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:16:60: note:   'std::pair<std::__cxx11::basic_string<char>, int>' is not derived from 'const std::reverse_iterator<_Iterator>'
   16 |                         D[cnt]=make_pair(D[i].first,D[cnt]-q);
      |                                                            ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:16:60: note:   'std::pair<std::__cxx11::basic_string<char>, int>' is not derived from 'const std::move_iterator<_IteratorL>'
   16 |                         D[cnt]=make_pair(D[i].first,D[cnt]-q);
      |                                                            ^
Language: C++

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

typedef struct box { int val; string name; box *prev, *next; } box_t;

box_t* init()
{
    box_t* head = new box_t;
    head->val = -1;
    head->name = '\0';
    head->next = NULL;
    head->prev = NULL;
    return head;
}

box_t* make_tail(box_t* head)
{
    box_t* tail = new box_t;
    tail->val = -1;
    tail->name = '\0';
    head->next = tail;
    tail->next = NULL;
    tail->prev = head;
    return tail;
}

box_t* b_insert(box_t* tail, int data, string str)
{
    box_t* box = new box_t;
    box->val = data;
    box->name = str;
    box->prev = tail->prev;
    box->next = tail;
    tail->prev->next = box;
    tail->prev = box;
    return box;
}

int f_delete(box_t* head)
{
    if(!(head->next->next)) return -1;
    box_t* box = head->next;
    head->next = box->next;
    box->next->prev = head;
    delete box;
    return 1;
}

void f_cycle(box_t* head, box_t* tail)
{
    box_t* box1 = head->next;
    box_t* box2 = tail->prev;
    if(box1 == tail || box1 == box2) return;
    box1->next->prev = head;
    head->next = box1->next;
    box2->next = box1;
    box1->prev = box2;
    box1->next = tail;
    tail->prev = box1;
    return;
}

int task(box_t* head, box_t* tail, int t, int q)
{
    box_t* box = head->next;
    if(box->next == tail){
        t = t + box->val;
        cout << box->name;
        printf(" %d\n", t);
        delete box;
        return -1;
    }
    if(box->val > q){
        box->val -= q;
        t = t + q;
        f_cycle(head, tail);
        return t;
    }
    t = t + box->val;
    cout << box->name;
    printf(" %d\n", t);
    f_delete(head);
    return t;
}

int main()
{
    box_t* head = init();
    box_t* tail = make_tail(head);
    int i, n, w, q;
    scanf("%d %d", &n, &q);
    string s;
    for(i = 0; i < n; i++){ scanf("%s", s); scanf("%d", &w); b_insert(tail, w, s); }
    int time = 0;
    do{
        time = task(head, tail, time, q);
    }while(time > 0);
    r

Compiler output:
a.cc: In function 'int main()':
a.cc:100:5: error: 'r' was not declared in this scope
  100 |     r
      |     ^
a.cc:100:6: error: expected '}' at end of input
  100 |     r
      |      ^
a.cc:89:1: note: to match this '{'
   89 | {
      | ^
Language: C++

#include<iostream>
#include<string>

using namespace std;

const int MAX = 100001;
int alltime = 0;

class pro
{
public:
	string name;
	int time;
	void input(string, int);
	void print();
	pro& operator=(const pro);
};

void pro::input(string name, int time)
{
	pro::name = name;
	pro::time = time;
}

void pro::print()
{
	cout << name << " " << alltime << endl;
}

pro& pro::operator=(const pro pro)
{
	name = pro.name;
	time = pro.time;
	return *this;
}

class queue
{
private:
	pro s[MAX];
	int head;
	int tail;
public:
	queue();
	void initialize();
	bool empty();
	bool full();
	void enqueue(pro);
	pro dequeue();
	void rein(int);
};

queue::queue()
{
	head = tail = 0;
}

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

bool queue::empty()
{
	return head == tail;
}

bool queue::full()
{
	if (tail + 1 == MAX)return head == 0;
	else return head == tail + 1;
}

void queue::enqueue(pro x)
{
	if (full())return;
	s[tail] = x;
	tail++;
	if (tail == MAX)tail = 0;
}

pro queue::dequeue()
{
	if (empty())return;
	pro v = s[head];
	head++;
	if (head == MAX)head = 0;
	return v;
}

void queue::rein(int q)
{
	int a;
	if (tail == 0)a = MAX - 1;
	else a = tail - 1;
	s[a].time -= q;
}

int main()
{
	queue queue;
	pro now;
	int n, q, i, time;
	string str;
	cin >> n >> q;
	for (i = 0; i < n; i++)
	{
		cin >> str >> time;
		now.input(str, time);
		queue.enqueue(now);
	}
	while (!queue.empty())
	{
		now = queue.dequeue();
		if (now.time <= q)
		{
			alltime += now.time;
			now.print();
		}
		else
		{
			alltime += q;
			queue.enqueue(now);
			queue.rein(q);
		}
	}
    return 0;
}

Compiler output:
a.cc: In member function 'pro queue::dequeue()':
a.cc:84:21: error: return-statement with no value, in function returning 'pro' [-fpermissive]
   84 |         if (empty())return;
      |                     ^~~~~~
a.cc:89: confused by earlier errors, bailing out
Language: C++

#include<iostream>
#include<string>

using namespace std;

const int MAX = 100001;
int alltime = 0;

class pro
{
public:
	string name;
	int time;
	void input(string, int);
	void print();
	pro& operator=(const pro);
};

void pro::input(string name, int time)
{
	pro::name = name;
	pro::time = time;
}

void pro::print()
{
	cout << name << " " << alltime << endl;
}

pro& pro::operator=(const pro pro)
{
	name = pro.name;
	time = pro.time;
	return *this;
}

class queue
{
private:
	pro s[MAX];
	int head;
	int tail;
public:
	queue();
	void initialize();
	bool empty();
	bool full();
	void enqueue(pro);
	pro dequeue();
	void rein(int);
};

queue::queue()
{
	head = tail = 0;
}

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

bool queue::empty()
{
	return head == tail;
}

bool queue::full()
{
	if (tail + 1 == MAX)return head == 0;
	else return head == tail + 1;
}

void queue::enqueue(pro x)
{
	if (full())return;
	s[tail] = x;
	tail++;
	if (tail == MAX)tail = 0;
}

pro queue::dequeue()
{
	if (empty())pro a;a.input("a",0);return a;
	pro v = s[head];
	head++;
	if (head == MAX)head = 0;
	return v;
}

void queue::rein(int q)
{
	int a;
	if (tail == 0)a = MAX - 1;
	else a = tail - 1;
	s[a].time -= q;
}

int main()
{
	queue queue;
	pro now;
	int n, q, i, time;
	string str;
	cin >> n >> q;
	for (i = 0; i < n; i++)
	{
		cin >> str >> time;
		now.input(str, time);
		queue.enqueue(now);
	}
	while (!queue.empty())
	{
		now = queue.dequeue();
		if (now.time <= q)
		{
			alltime += now.time;
			now.print();
		}
		else
		{
			alltime += q;
			queue.enqueue(now);
			queue.rein(q);
		}
	}
    return 0;
}

Compiler output:
a.cc: In member function 'pro queue::dequeue()':
a.cc:84:27: error: 'a' was not declared in this scope
   84 |         if (empty())pro a;a.input("a",0);return a;
      |                           ^
Language: C++

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

#define LEN 100005

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

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

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

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

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

int main() {

	int time = 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;
		time += c;
		if (u.t > 0) {
			enqueue(u);	
		}
		else{
			printf("%s %d\n", u.name, time);
		}
	}


	return 0;

}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<stdio.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:40:9: error: 'scanf' was not declared in this scope
   40 |         scanf("%d %d", &n, &q);
      |         ^~~~~
a.cc:59:25: error: 'printf' was not declared in this scope
   59 |                         printf("%s %d\n", u.name, time);
      |                         ^~~~~~
a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    3 | #include<string.h>
  +++ |+#include <cstdio>
    4 |