Language: C++

#include<iostream>
#include<string>
//#include<queue>
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);
}

Proc queue::front(){
	if(isEnpty()){
		Proc er;
		er.tim=-1;
		return er;
	}
	return Q[fp];
}
void queue::pop(){
	if(isEnpty())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.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:29:6: error: extra qualification 'queue::' on member 'push' [-fpermissive]
   29 | void queue::push(Proc d){
      |      ^~~~~
a.cc:36:6: error: extra qualification 'queue::' on member 'front' [-fpermissive]
   36 | Proc queue::front(){
      |      ^~~~~
a.cc:44:6: error: extra qualification 'queue::' on member 'pop' [-fpermissive]
   44 | void queue::pop(){
      |      ^~~~~
a.cc:80:2: error: expected '}' at end of input
   80 | }
      |  ^
a.cc:14:12: note: to match this '{'
   14 | class queue{
      |            ^
a.cc: In constructor 'queue::queue()':
a.cc:19:20: error: expected primary-expression before ')' token
   19 |  queue(){fp=0;rp=0;)
      |                    ^
a.cc:21:13: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   21 |  bool isFull() const {return (next(rp)==fp);}
      |             ^~
a.cc:21:13: note: remove parentheses to default-initialize a variable
   21 |  bool isFull() const {return (next(rp)==fp);}
      |             ^~
      |             --
a.cc:21:13: note: or replace parentheses with braces to value-initialize a variable
a.cc:21:22: error: a function-definition is not allowed here before '{' token
   21 |  bool isFull() const {return (next(rp)==fp);}
      |                      ^
a.cc:22:14: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   22 |  bool isEmpty() const{return(rp==fp);}
      |              ^~
a.cc:22:14: note: remove parentheses to default-initialize a variable
   22 |  bool isEmpty() const{return(rp==fp);}
      |              ^~
      |              --
a.cc:22:14: note: or replace parentheses with braces to value-initialize a variable
a.cc:22:22: error: a function-definition is not allowed here before '{' token
   22 |  bool isEmpty() const{return(rp==fp);}
      |                      ^
a.cc:24:12: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   24 |  Proc front();
      |            ^~
a.cc:24:12: note: remove parentheses to default-initialize a variable
   24 |  Proc front();
      |            ^~
      |            --
a.cc:24:12: note: or replace parentheses with braces to value-initialize a variable
a.cc: In member function 'void queue::push(Proc)':
a.cc:30:12: error: 'isFull' was not declared in this scope
   30 |         if(isFull())return;
      |            ^~~~~~
a.cc:33:16: error: no matching function for call to 'next(int&)'
   33 |         rp:next(rp);
      |            ~~~~^~~~
In file included from /usr/include/c++/14/string:47,
                 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_base_funcs.h:232:5: note: candidate: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h: In substitution of 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type) [with _InputIterator = int]':
a.cc:33:9:   required from here
   33 |         rp:next(rp);
      |            ~~~~^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: error: no type named 'difference_type' in 'struct std::iterator_traits<int>'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc: In member function 'Proc queue::front()':
a.cc:37:12: error: 'isEnpty' was not declared in this scope
   37 |         if(isEnpty()){
      |            ^~~~~~~
a.cc: In member function 'void queue::pop()':
a.cc:45:12: error: 'isEnpty' was not declared in this scope
   45 |         if(isEnpty())return;
      |            ^~~~~~~
a.cc:46:16: error: no matching function for call to 'next(int&)'
   46 |         fp=next(fp);
      |            ~~~~^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidate: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h: In substitution of 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type) [with _InputIterator = int]':
a.cc:46:9:   required from here
   46 |         fp=next(fp);
      |            ~~~~^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: error: no type named 'difference_type' in 'struct std::iterator_traits<int>'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc: In member function 'int queue::main()':
a.cc:65:13: error: 'class queue' has no member named 'isEmpty'
   65 | while((!que.isEmpty()){
      |             ^~~~~~~
a.cc:65:23: error: expected ')' before '{' token
   65 | while((!que.isEmpty()){
      |                       ^
a.cc:65:6: note: to match this '('
   65 | while((!que.isEmpty()){
      |      ^
a.cc: At global scope:
a.cc:80:2: error: expected unqualified-id at end of input
   80 | }
      |  ^