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

#include <stdio.h>
#include <stdlib.h>
#define QSIZE (100000)

struct proc *Q[QSIZE];
int soq=0,eoq=0;

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

struct proc *enQ(struct proc *data){
  int newEnd;  
  newEnd = (eoq+1)%QSIZE;
  Q[eoq] = data;
  eoq = newEnd;
}

struct proc *deQ(){
  int oldSt;
  if(soq==eoq){
    return NULL;
  }
  oldSt = soq;
  soq = (soq+1)/QSIZE;
  return Q[oldSt];
}

main(){
  int n,q;
  int i;
  int total = 0;
  struct proc *data;
  struct proc dat[100000];
  scanf("%d %d",&n,&q);
  for(i=0;i<n;i++){
    scanf("%s %d",dat[i].name,&dat[i].time);
    enQ(dat[i]);
  }
  data = deQ();
  while(data!=NULL){
    if(data->time > q){
      total+=q;
      data->time -=q;
      enQ(data);
    }else{
      total += data->time;
      printf("%s %d\n",data->name,total);
    }
    data = deQ();
  }
}

Compiler output:
a.cc: In function 'proc* enQ(proc*)':
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      | ^
a.cc: At global scope:
a.cc:30:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   30 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:39:14: error: cannot convert 'proc' to 'proc*'
   39 |     enQ(dat[i]);
      |         ~~~~~^
      |              |
      |              proc
a.cc:13:31: note:   initializing argument 1 of 'proc* enQ(proc*)'
   13 | struct proc *enQ(struct proc *data){
      |                  ~~~~~~~~~~~~~^~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#define QSIZE (100000)

struct proc *Q[QSIZE];
int soq=0,eoq=0;

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

struct proc *enQ(struct proc *data){
  int newEnd;  
  newEnd = (eoq+1)%QSIZE;
  Q[eoq] = data;
  eoq = newEnd;
}

struct proc *deQ(){
  int oldSt;
  if(soq==eoq){
    return NULL;
  }
  oldSt = soq;
  soq = (soq+1)/QSIZE;
  return Q[oldSt];
}

main(){
  int n,q;
  int i;
  int total = 0;
  struct proc *data;
  struct proc dat[100000];
  scanf("%d %d",&n,&q);
  for(i=0;i<n;i++){
    scanf("%s %d",dat[i].name,&dat[i].time);
    enQ(&dat[i]);
  }
  while(n>0){
    data = *deQ();
    if(data->time > q){
      total+=q;
      data->time -=q;
      enQ(data);
    }else{
      total += data->time;
      printf("%s %d\n",data->name,total);
      n--;
    }
  }
}

Compiler output:
a.cc: In function 'proc* enQ(proc*)':
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      | ^
a.cc: At global scope:
a.cc:30:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   30 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:42:12: error: cannot convert 'proc' to 'proc*' in assignment
   42 |     data = *deQ();
      |            ^~~~~~
      |            |
      |            proc
Language: C++

#include <stdio.h>
#define QSIZE (100000)

struct proc *Q[QSIZE];
int soq=0,eoq=0;

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

struct proc *enQ(struct proc *data){
  Q[eoq] = data;
  eoq = (eoq+1)%QSIZE;
  return data
}

struct proc *deQ(){
  int oldSt;
  if(soq==eoq){
    return NULL;
  }
  oldSt = soq;
  soq = (soq+1)/QSIZE;
  return Q[oldSt];
}

main(){
  int n,q;
  int i;
  int total = 0;
  struct proc *data;
  struct proc dat[100000];
  scanf("%d %d",&n,&q);
  for(i=0;i<n;i++){
    scanf("%s %d",dat[i].name,&dat[i].time);
    enQ(&dat[i]);
  }
  while(n>0){
    data = deQ();
    if(data->time > q){
      total+=q;
      data->time -=q;
      enQ(data);
    }else{
      total += data->time;
      printf("%s %d\n",data->name,total);
      n--;
    }
  }
}

Compiler output:
a.cc: In function 'proc* enQ(proc*)':
a.cc:15:14: error: expected ';' before '}' token
   15 |   return data
      |              ^
      |              ;
   16 | }
      | ~             
a.cc: At global scope:
a.cc:28:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   28 | main(){
      | ^~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#define QSIZE (100000)

struct proc *Qu[QSIZE];
int soq=0,eoq=0;

struct proc{
  char name[11];
  int ti;
};

struct proc *enQ(struct proc *data){
  Qu[eoq] = data;
  eoq = (eoq+1)%QSIZE;
  return data;
}

struct proc *deQ(){
  int oldSt;
  if(soq==eoq){
    return NULL;
  }
  oldSt = soq;
  soq = (soq+1)%QSIZE;
  return Qu[oldSt];
}

int main(){
  int n,q;
  int i;
  int total = 0;
  struct proc *data;
  scanf("%d %d",&n,&q);
  for(i=0;i<n;i++){
    data = malloc(sizeof(struct proc));
    scanf("%s %d",(*data).name,&((*data).ti));
    enQ(data);
  }
  while(n>0){
    data = deQ();
    if(data->ti > q){
      total+=q;
      data->ti -=q;
      enQ(data);
    }else{
      total += data->ti;
      printf("%s %d\n",data->name,total);
      n--;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:18: error: invalid conversion from 'void*' to 'proc*' [-fpermissive]
   36 |     data = malloc(sizeof(struct proc));
      |            ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                  |
      |                  void*
Language: C++

#include<iostream>
#include<queue>
using namespace std;
struct process { char name[10]; int time; };
int main () {
	int n, q;
	cin >> n >> q;
	queue<process> TQ;
	//input
	for(int i = 0; i < n; i++) {
		process qu;
		cin >> qu.name >> qu.time;
		TQ.push(qu);
	}
	//process -> output
	int sum = 0;
	while ( !TQ.empty() ) {
		qu = TQ.front();
		if (qu.time <= q) {
			sum += qu.time;
			cout << qu.name << " " << sum << "?\n";
		} else {
			sum += q;
			qu.time -= q;
			TQ.push(qu);
		}
		TQ.pop();
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'qu' was not declared in this scope; did you mean 'q'?
   18 |                 qu = TQ.front();
      |                 ^~
      |                 q
Language: C++

#include<iotream>
#include<queue>
#include<string>
using namespace std;
int main(){
  int n, q;  
  cin >> n >> q;

  queue< pair<string,int> > que;
  string name;
  int time;

  for(int i = 0; i < n; i++){
    cin >> name >> time;
    que.push(make_pair<string,int>(name,time));
  }
  
  int cnt = 0;

  while(!que.empty()){
    pair<string,int> p = que.front();
    pue.pop;

    if(p.second <= q){
      cnt += p.second;
      cout << p.first << " " << cnt << "\n";
    }else{
      p.second -= q;
      cnt += q;
      que.push(p);
    }
    
  }
}

Compiler output:
a.cc:1:9: fatal error: iotream: No such file or directory
    1 | #include<iotream>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<queue>
#include<string>
using namespace std;
int main(){
  int n, q;  
  cin >> n >> q;

  queue< pair<string,int> > que;
  string name;
  int time;

  for(int i = 0; i < n; i++){
    cin >> name >> time;
    que.push(make_pair<string,int>(name,time));
  }
  
  int cnt = 0;

  while(!que.empty()){
    pair<string,int> p = que.front();
    pue.pop;

    if(p.second <= q){
      cnt += p.second;
      cout << p.first << " " << cnt << "\n";
    }else{
      p.second -= q;
      cnt += q;
      que.push(p);
    }
    
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:36: error: cannot bind rvalue reference of type 'std::__cxx11::basic_string<char>&&' to lvalue of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   15 |     que.push(make_pair<string,int>(name,time));
      |                                    ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 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_pair.h:1132:21: note:   initializing argument 1 of 'constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = __cxx11::basic_string<char>; _T2 = int; typename __strip_reference_wrapper<typename decay<_Tp>::type>::__type = __cxx11::basic_string<char>; typename decay<_Tp>::type = __cxx11::basic_string<char>; typename __strip_reference_wrapper<typename decay<_Tp2>::type>::__type = int; typename decay<_Tp2>::type = int]'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |               ~~~~~~^~~
a.cc:22:5: error: 'pue' was not declared in this scope; did you mean 'que'?
   22 |     pue.pop;
      |     ^~~
      |     que
Language: C++

#include<iostream>
#include<queue>
#include<string>
using namespace std;
int main(){
  int n, q;  
  cin >> n >> q;

  queue< pair<string,int> > que;
  string name;
  int time;

  for(int i = 0; i < n; i++){
    cin >> name >> time;
    que.push(make_pair<string,int>(name,time));
  }
  
  int cnt = 0;

  while(!que.empty()){
    pair<string,int> p = que.front();
    que.pop;

    if(p.second <= q){
      cnt += p.second;
      cout << p.first << " " << cnt << "\n";
    }else{
      p.second -= q;
      cnt += q;
      que.push(p);
    }
    
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:36: error: cannot bind rvalue reference of type 'std::__cxx11::basic_string<char>&&' to lvalue of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   15 |     que.push(make_pair<string,int>(name,time));
      |                                    ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 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_pair.h:1132:21: note:   initializing argument 1 of 'constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = __cxx11::basic_string<char>; _T2 = int; typename __strip_reference_wrapper<typename decay<_Tp>::type>::__type = __cxx11::basic_string<char>; typename decay<_Tp>::type = __cxx11::basic_string<char>; typename __strip_reference_wrapper<typename decay<_Tp2>::type>::__type = int; typename decay<_Tp2>::type = int]'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |               ~~~~~~^~~
a.cc:22:9: 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> > >]'
   22 |     que.pop;
      |     ~~~~^~~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_queue.h:316:7: note: declared here
  316 |       pop()
      |       ^~~
Language: C++

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

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

P Q[LEN];

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

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

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

int main(){
int elaps =0,c;
P u;
int i,q;

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

Compiler output:
a.cc:8:19: error: expected ']' before ';' token
    8 | #define LEN 100005;
      |                   ^
a.cc:15:5: note: in expansion of macro 'LEN'
   15 | P Q[LEN];
      |     ^~~
a.cc:15:8: error: expected unqualified-id before ']' token
   15 | P Q[LEN];
      |        ^
a.cc: In function 'void enqueue(P)':
a.cc:18:1: error: 'Q' was not declared in this scope
   18 | Q[tail]=x;
      | ^
a.cc:18:3: error: 'tail' was not declared in this scope; did you mean 'tanl'?
   18 | Q[tail]=x;
      |   ^~~~
      |   tanl
a.cc: In function 'P dequeue()':
a.cc:23:5: error: 'Q' was not declared in this scope
   23 | P x=Q[head];
      |     ^
a.cc:23:7: error: 'head' was not declared in this scope
   23 | P x=Q[head];
      |       ^~~~
a.cc: In function 'int main()':
a.cc:35:19: error: 'n' was not declared in this scope
   35 |   scanf("%d %d", &n,&q);
      |                   ^
a.cc:37:12: error: 'Q' was not declared in this scope
   37 | scanf("%s",Q[i].name);
      |            ^
a.cc:40:3: error: 'head' was not declared in this scope
   40 |   head=1;tail =n+1;
      |   ^~~~
a.cc:40:10: error: 'tail' was not declared in this scope; did you mean 'tanl'?
   40 |   head=1;tail =n+1;
      |          ^~~~
      |          tanl
a.cc:47:33: error: expected ';' before '}' token
   47 |   printf("%s %d\n",u.name,elaps)
      |                                 ^
      |                                 ;
   48 |   }
      |   ~
Language: C++

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

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

P Q[LEN];

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

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

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

int main(){
int elaps =0,c;
P u;
int i,q;

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

Compiler output:
a.cc: In function 'void enqueue(P)':
a.cc:18:3: error: 'tail' was not declared in this scope; did you mean 'tanl'?
   18 | Q[tail]=x;
      |   ^~~~
      |   tanl
a.cc: In function 'P dequeue()':
a.cc:23:7: error: 'head' was not declared in this scope
   23 | P x=Q[head];
      |       ^~~~
a.cc: In function 'int main()':
a.cc:35:19: error: 'n' was not declared in this scope
   35 |   scanf("%d %d", &n,&q);
      |                   ^
a.cc:38:18: error: 'P' {aka 'struct pp'} has no member named 'q'
   38 | scanf("%d",&Q[i].q);
      |                  ^
a.cc:40:3: error: 'head' was not declared in this scope
   40 |   head=1;tail =n+1;
      |   ^~~~
a.cc:40:10: error: 'tail' was not declared in this scope; did you mean 'tanl'?
   40 |   head=1;tail =n+1;
      |          ^~~~
      |          tanl
a.cc:47:33: error: expected ';' before '}' token
   47 |   printf("%s %d\n",u.name,elaps)
      |                                 ^
      |                                 ;
   48 |   }
      |   ~
Language: C++

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

typedef struct pp{
char name[100];
int t;
}P;
int head,tail,n;
P Q[LEN];

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

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

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

int main(){
int elaps =0,c;
P u;
int i,q;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:38:18: error: 'P' {aka 'struct pp'} has no member named 'q'
   38 | scanf("%d",&Q[i].q);
      |                  ^
a.cc:47:33: error: expected ';' before '}' token
   47 |   printf("%s %d\n",u.name,elaps)
      |                                 ^
      |                                 ;
   48 |   }
      |   ~
Language: C++

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

typedef struct pp{
char name[100];
int t;
}P;
int head,tail,n;
P Q[LEN];

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

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

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

int main(){
int elaps =0,c;
P u;
int i,q;

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

  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:33: error: expected ';' before '}' token
   47 |   printf("%s %d\n",u.name,elaps)
      |                                 ^
      |                                 ;
   48 | 
   49 |   }
      |   ~                              
a.cc:51:2: error: expected '}' at end of input
   51 | }
      |  ^
a.cc:30:11: note: to match this '{'
   30 | int main(){
      |           ^
Language: C++

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

int main(){
    int n,q;
    cin >> n >> q;
    queue<string> S;
    queue<int> Q;
    for(int i = 0; i < n; i++){
        string name;
        int time;
        cin >> name >> time;
        S.push(name);
        Q.push(time);
    }
    while(S.top() != void){
        if(Q.top() - q > 0){
            S.push(S.top());
            S.pop();
            Q.push(Q.top() - q);
            Q.pop();
        }else{
            printf("%s %d\n", S.top(), Q.top());
            S.pop();
            Q.pop();
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'class std::queue<std::__cxx11::basic_string<char> >' has no member named 'top'; did you mean 'pop'?
   19 |     while(S.top() != void){
      |             ^~~
      |             pop
a.cc:19:22: error: expected primary-expression before 'void'
   19 |     while(S.top() != void){
      |                      ^~~~
a.cc:19:21: error: expected ')' before 'void'
   19 |     while(S.top() != void){
      |          ~          ^~~~~
      |                     )
a.cc:19:26: error: expected unqualified-id before ')' token
   19 |     while(S.top() != void){
      |                          ^
Language: C++

//????£???????10?????????????????°
#include <string>
#include <queue>
#include <stdio.h>
#include <iostream>
using namespace std;

int main(){
    int n,q;
    cin >> n >> q;
    queue<string> S;
    queue<int> Q;
    for(int i = 0; i < n; i++){
        string name;
        int time;
        cin >> name >> time;
        S.push(name);
        Q.push(time);
    }
    while(S.top()){
        if(Q.top() - q > 0){
            S.push(S.top());
            S.pop();
            Q.push(Q.top() - q);
            Q.pop();
        }else{
            printf("%s %d\n", S.top(), Q.top());
            S.pop();
            Q.pop();
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: 'class std::queue<std::__cxx11::basic_string<char> >' has no member named 'top'; did you mean 'pop'?
   20 |     while(S.top()){
      |             ^~~
      |             pop
a.cc:21:14: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
   21 |         if(Q.top() - q > 0){
      |              ^~~
      |              pop
a.cc:22:22: error: 'class std::queue<std::__cxx11::basic_string<char> >' has no member named 'top'; did you mean 'pop'?
   22 |             S.push(S.top());
      |                      ^~~
      |                      pop
a.cc:24:22: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
   24 |             Q.push(Q.top() - q);
      |                      ^~~
      |                      pop
a.cc:27:33: error: 'class std::queue<std::__cxx11::basic_string<char> >' has no member named 'top'; did you mean 'pop'?
   27 |             printf("%s %d\n", S.top(), Q.top());
      |                                 ^~~
      |                                 pop
a.cc:27:42: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
   27 |             printf("%s %d\n", S.top(), Q.top());
      |                                          ^~~
      |                                          pop
Language: C++

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

int main(){
    int n,q;
    cin >> n >> q;
    queue<string> S;
    queue<int> Q;
    for(int i = 0; i < n; i++){
        string name;
        int time;
        cin >> name >> time;
        S.push(name);
        Q.push(time);
    }
    while(S.front()){
        if(Q.front() - q > 0){
            S.push(S.front());
            S.pop();
            Q.push(Q.front() - q);
            Q.pop();
        }else{
            printf("%s %d\n", S.front(), Q.front());
            S.pop();
            Q.pop();
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: could not convert 'S.std::queue<std::__cxx11::basic_string<char> >::front()' from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
   19 |     while(S.front()){
      |           ~~~~~~~^~
      |                  |
      |                  __gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type {aka std::__cxx11::basic_string<char>}
Language: C++


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

int main(){
    int n,q;
    cin >> n >> q;
    queue<string> S;
    queue<int> Q;
    for(int i = 0; i < n; i++){
        string name;
        int time;
        cin >> name >> time;
        S.push(name);
        Q.push(time);
    }
    while(S.front() != void){
        if(Q.front() - q > 0){
            S.push(S.front());
            S.pop();
            Q.push(Q.front() - q);
            Q.pop();
        }else{
            printf("%s %d\n", S.front(), Q.front());
            S.pop();
            Q.pop();
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:24: error: expected primary-expression before 'void'
   20 |     while(S.front() != void){
      |                        ^~~~
a.cc:20:23: error: expected ')' before 'void'
   20 |     while(S.front() != void){
      |          ~            ^~~~~
      |                       )
a.cc:20:28: error: expected unqualified-id before ')' token
   20 |     while(S.front() != void){
      |                            ^
Language: C++

#include <iostream>
#include <queue>
#include <string>
using namespace std;
int main(void){
  queue<pair<string,int>> a;
  int n,q,t,c=0;
  string name;
  cin>>n>>q;
  for(int i=0;i<n;i++){
    cin>>name>>t;
    a.enqueue(make_pair(name,t));
  }
  while(!a.empty()){
    pair<string,int> p=a.front();
    a.dequeue();
    if(p.second>q){
      p.second-=q;
      c+=q;
      a.enqueue(p);
    }
    else{
      c+=p.second;
      cout<<p.first<<" "<<c<<endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'class std::queue<std::pair<std::__cxx11::basic_string<char>, int> >' has no member named 'enqueue'; did you mean 'queue'?
   12 |     a.enqueue(make_pair(name,t));
      |       ^~~~~~~
      |       queue
a.cc:16:7: error: 'class std::queue<std::pair<std::__cxx11::basic_string<char>, int> >' has no member named 'dequeue'; did you mean 'queue'?
   16 |     a.dequeue();
      |       ^~~~~~~
      |       queue
a.cc:20:9: error: 'class std::queue<std::pair<std::__cxx11::basic_string<char>, int> >' has no member named 'enqueue'; did you mean 'queue'?
   20 |       a.enqueue(p);
      |         ^~~~~~~
      |         queue
Language: C++

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<queue>
#include<utility>
using namespace std;
#define maxn 100005
typedef pair<string,int> P;
int n,t;
string name;
int cost;
queue<P> q;
queue<P> ans;
int Time;
void Solve()
{
    while(!q.empty())
    {
        P p=q.front();
        P pp;
        if(p.second>t)
        {
            pp.first=p.first;
            pp.second=p.second-t;
            q.push(pp);
            q.pop();
            Time+=t;
        }
        else
        {
            Time+=p.second;
            ans.push(make_pair(p.first,time));
            q.pop();
        }

    }
}
int main()
{
    P sp;
    while(cin>>n>>t)
    {
        Time=0;
        for(int i=0;i<n;i++)
        {
            cin>>name>>cost;
            q.push(make_pair(name,cost));
        }

        Solve();

        while(!ans.empty())
        {
            cout<<ans.front().first<<" "<<ans.front().second<<endl;
            ans.pop();
        }

    }
    return 0;
}

Compiler output:
a.cc: In function 'void Solve()':
a.cc:32:21: error: no matching function for call to 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >::push(std::pair<std::__cxx11::basic_string<char>, long int (*)(long int*) noexcept>)'
   32 |             ans.push(make_pair(p.first,time));
      |             ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:4:
/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<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> > >; value_type = std::pair<std::__cxx11::basic_string<char>, int>]'
  283 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:283:30: note:   no known conversion for argument 1 from 'std::pair<std::__cxx11::basic_string<char>, long int (*)(long int*) noexcept>' to 'const std::queue<std::pair<std::__cxx11::basic_string<char>, int> >::value_type&' {aka 'const std::pair<std::__cxx11::basic_string<char>, int>&'}
  283 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:288:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(value_type&&) [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> > >; value_type = std::pair<std::__cxx11::basic_string<char>, int>]'
  288 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:288:25: note:   no known conversion for argument 1 from 'std::pair<std::__cxx11::basic_string<char>, long int (*)(long int*) noexcept>' to 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >::value_type&&' {aka 'std::pair<std::__cxx11::basic_string<char>, int>&&'}
  288 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
Language: C++

class Process1
  @name
  @time
  @endtime

  def initialize(name, time)
    @name = name
    @time = time
  end
end

def main
  line1 = STDIN.gets.chomp.split(" ")
  n = line1[0]
  q = line1[1]

  queue = Array.new(n)
  n.times do |i|
    line = STDIN.gets.chomp.split(" ")
    process = Process1.new(line[0], line[1])
    queue[i] = process
  end

  time = 0
  processes_ended = Array.new
  while queue.empty? == false
    process = queue.shift
    if process.time > q
      time += q
      process.time -= q
      queue.push(process)
    else
      time += process.time
      process.time -= process.time
      process.endtime = time
      processes_ended.push(process)
    end
  end
  processes_ended.each do |process|
    puts "#{process.name} #{process.endtime}"
  end
end

main

Compiler output:
a.cc:2:3: error: stray '@' in program
    2 |   @name
      |   ^
a.cc:3:3: error: stray '@' in program
    3 |   @time
      |   ^
a.cc:4:3: error: stray '@' in program
    4 |   @endtime
      |   ^
a.cc:7:5: error: stray '@' in program
    7 |     @name = name
      |     ^
a.cc:8:5: error: stray '@' in program
    8 |     @time = time
      |     ^
a.cc:3:4: error: expected initializer before 'time'
    3 |   @time
      |    ^~~~
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <bits\stdc++.h>

using namespace std;

int main()
{
	map<string, int> m;
	queue<pair<string, int>> Q;
	int n, q;
	int consumed_time = 0;
	scanf("%d %d", &n, &q);
	for (int i = 0; i < n; i++)
	{
		string s;
		int t;
		cin >> s >> t;
		m.insert(make_pair(s,t));
		Q.push(make_pair(s, t));
	}
	/*for (auto i = m.begin(); i != m.end() ; i++)
	{
		cout << i->first << " " << i->second << endl;
	}*/

	while (!Q.empty())
	{
		auto t = Q.front(); Q.pop();
		if (t.second <= q)
		{
			consumed_time += t.second;
			cout << t.first << " " << consumed_time << endl;
		}
		else
		{
			consumed_time += q;
			Q.push(make_pair(t.first, t.second - q));
		}
	}

	return 0;
}

Compiler output:
a.cc:2:10: fatal error: bits\stdc++.h: No such file or directory
    2 | #include <bits\stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <math.h>
#include <sstream>
#include <vector>

using namespace std;
struct wait_que {
	string name;
	int time;
	int cmp_flg;
};
void completeProcess(int size, int q);

static vector<struct wait_que> wqs;

int main()
{
	string str;
	getline(cin, str);
	// get number
	int cnt = 0;
	int num[2];
	string buff;
	stringstream ss(str);
	while (getline(ss, buff, ' ')) {
		stringstream ss_buf(buff);
		ss_buf >> num[cnt];
		cnt++;
	}

	int counter = 0;
        int total_time = 0;
	int cnt = num[0];
	int target_num = 0;
	while (true) {
		if (counter < num[0]) {
		getline(cin, str);

		struct wait_que obj;

		int split_num = str.find_first_of(' ');
		obj.name = str.substr(0, split_num);

		string time_str = str.substr(split_num + 1, str.size() - split_num);
		stringstream time_ss(time_str);
		time_ss >> obj.time;
		
		obj.cmp_flg = 0;

                wqs.push_back(obj);
                counter++;
                }

                // check target element.
		struct wait_que *tmp = &wqs[target_num];

		if ((*tmp).time - q > 0) {
			(*tmp).time -= q;
			total_time += q;
			target_num = (target_num + 1) % cnt;
		} else {
			total_time += (*tmp).time;
			cout << (*tmp).name << " " << total_time << endl;
			wqs.erase(wqs.begin() + target_num);
			cnt--;
			if (cnt == 0) {
				break;
			} else {
				target_num = target_num % cnt;
			}
		}
	}
	//completeProcess(ary, num[0], num[1]);

}

void completeProcess(int size,  int q) {
	int total_time = 0;
	int cnt = size;
	int target_num = 0;
	while (true) {
		// check target element.
		struct wait_que *tmp = &wqs[target_num];

		if ((*tmp).time - q > 0) {
			(*tmp).time -= q;
			total_time += q;
			target_num = (target_num + 1) % cnt;
		} else {
			total_time += (*tmp).time;
			cout << (*tmp).name << " " << total_time << endl;
			wqs.erase(wqs.begin() + target_num);
			cnt--;
			if (cnt == 0) {
				break;
			} else {
				target_num = target_num % cnt;
			}
		}
	}
	return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:13: error: redeclaration of 'int cnt'
   33 |         int cnt = num[0];
      |             ^~~
a.cc:21:13: note: 'int cnt' previously declared here
   21 |         int cnt = 0;
      |             ^~~
a.cc:57:35: error: 'q' was not declared in this scope
   57 |                 if ((*tmp).time - q > 0) {
      |                                   ^
Language: C++

#include <iostream>
#include <math.h>
#include <sstream>
#include <vector>

using namespace std;
struct wait_que {
	string name;
	int time;
	int cmp_flg;
};
void completeProcess(int size, int q);

static vector<struct wait_que> wqs;

int main()
{
	string str;
	getline(cin, str);
	// get number
	int cnt = 0;
	int num[2];
	string buff;
	stringstream ss(str);
	while (getline(ss, buff, ' ')) {
		stringstream ss_buf(buff);
		ss_buf >> num[cnt];
		cnt++;
	}

	int counter = 0;
        int total_time = 0;
	cnt = num[0];
	int target_num = 0;
	while (true) {
		if (counter < num[0]) {
		getline(cin, str);

		struct wait_que obj;

		int split_num = str.find_first_of(' ');
		obj.name = str.substr(0, split_num);

		string time_str = str.substr(split_num + 1, str.size() - split_num);
		stringstream time_ss(time_str);
		time_ss >> obj.time;
		
		obj.cmp_flg = 0;

                wqs.push_back(obj);
                counter++;
                }

                // check target element.
		struct wait_que *tmp = &wqs[target_num];

		if ((*tmp).time - q > 0) {
			(*tmp).time -= q;
			total_time += q;
			target_num = (target_num + 1) % cnt;
		} else {
			total_time += (*tmp).time;
			cout << (*tmp).name << " " << total_time << endl;
			wqs.erase(wqs.begin() + target_num);
			cnt--;
			if (cnt == 0) {
				break;
			} else {
				target_num = target_num % cnt;
			}
		}
	}
	//completeProcess(ary, num[0], num[1]);

}

void completeProcess(int size,  int q) {
	int total_time = 0;
	int cnt = size;
	int target_num = 0;
	while (true) {
		// check target element.
		struct wait_que *tmp = &wqs[target_num];

		if ((*tmp).time - q > 0) {
			(*tmp).time -= q;
			total_time += q;
			target_num = (target_num + 1) % cnt;
		} else {
			total_time += (*tmp).time;
			cout << (*tmp).name << " " << total_time << endl;
			wqs.erase(wqs.begin() + target_num);
			cnt--;
			if (cnt == 0) {
				break;
			} else {
				target_num = target_num % cnt;
			}
		}
	}
	return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:35: error: 'q' was not declared in this scope
   57 |                 if ((*tmp).time - q > 0) {
      |                                   ^
Language: C++

#include<stdio.h>
#include<string.h>
#define LEN 100005
typedef struct pp{
char name[100];
int t;
}
p;

p q[LEN];
int h,t,n;
void enqueue(p x){
q[t]=x;
t=(t+1)%LEN;
}

p dnqueue(){
p x=q[h];
h=(h+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);
    }
    h=1;
    t=n+1;
    while(h!=t){
        u=dnqueue();
        c=min(q,u.t);
        u.t-=c;
        elaps+=c;
        if(u.t>0) enqueue(u);
        else{
            printf("%s %d\n",u.name,elaps);
    }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:21: error: invalid types 'int[int]' for array subscript
   31 |         scanf("%s",q[i].name);
      |                     ^
a.cc:32:22: error: invalid types 'int[int]' for array subscript
   32 |         scanf("%d",&q[i].t);
      |                      ^
Language: C++

#include<stdio.h>
#include<math.h>
const int LEN = 100000;//??????????????§??????
struct pp
{
	char name[10];
	int time;
} ;
pp P[LEN];
int head, tail, n;
void enqueue(struct pp x)//??\????????°
{
	P[tail] = x;//?°?x?????\??°????°?
	tail = tail + 1;//??¨?????????????????????????????????head=(tail + 1) % LEN??¶??´???????????????
}
struct pp dequeue()//???????????°
{
	struct pp x = P[head];//?°?head??????????????´????´?????????\??????x
	head = head + 1;
	return x;//????????????????´?
}

int main()
{
	int alltime=0;//?´??????¶??´  ?±???¨????????????????§????
	int n, q;//n??¨???????????°???q??¨?????¶??´????????§?°?
	struct pp u;
	scanf("%d%d",&n,&q);
	//?°?????????????????????°?????????
	for (int i = 0; i < n; i++)
	{
		scanf("%s%d",& P[i].name,& P[i].time);//cin >> P[i].name >> P[i].time;
	}
	head = 0; tail = n;
	//?¨??????¶??´????????¬???
	while (head != tail)
	{
		u = dequeue();//?????´????´???????
		int c = min(q, u.time);//????????¶??´????????§?°??????\????????????????????¶??´
		u.time = u.time - q;//????????????????????????????????¶??´
		alltime = alltime + c;
		if (u.time > 0)
			enqueue(u);//??????????????¬????????\??°????°?
		else
		{
			printf("%s %d\n",u.name,alltime);
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:25: error: 'min' was not declared in this scope; did you mean 'std::min'?
   39 |                 int c = min(q, u.time);//????????¶??´????????§?°??????\????????????????????¶??´
      |                         ^~~
      |                         std::min
In file included from /usr/include/c++/14/bits/specfun.h:43,
                 from /usr/include/c++/14/cmath:3906,
                 from /usr/include/c++/14/math.h:36,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
const int LEN = 100000;//??????????????§??????
struct pp
{
	char name[10];
	int time;
} ;
pp P[LEN];
int head, tail, n;
void enqueue(struct pp x)//??\????????°
{
	P[tail] = x;//?°?x?????\??°????°?
	tail = tail + 1;//??¨?????????????????????????????????head=(tail + 1) % LEN??¶??´???????????????
}
struct pp dequeue()//???????????°
{
	struct pp x = P[head];//?°?head??????????????´????´?????????\??????x
	head = head + 1;
	return x;//????????????????´?
}

int main()
{
	int alltime=0;//?´??????¶??´  ?±???¨????????????????§????
	int n, q;//n??¨???????????°???q??¨?????¶??´????????§?°?
	struct pp u;
	scanf("%d%d",&n,&q);
	//?°?????????????????????°?????????
	for (int i = 0; i < n; i++)
	{
		scanf("%s%d",& P[i].name,& P[i].time);//cin >> P[i].name >> P[i].time;
	}
	head = 0; tail = n;
	//?¨??????¶??´????????¬???
	while (head != tail)
	{
		u = dequeue();//?????´????´???????
		int c = min(q, u.time);//????????¶??´????????§?°??????\????????????????????¶??´
		u.time = u.time - q;//????????????????????????????????¶??´
		alltime = alltime + c;
		if (u.time > 0)
			enqueue(u);//??????????????¬????????\??°????°?
		else
		{
			printf("%s %d\n",u.name,alltime);
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:25: error: 'min' was not declared in this scope; did you mean 'main'?
   39 |                 int c = min(q, u.time);//????????¶??´????????§?°??????\????????????????????¶??´
      |                         ^~~
      |                         main
Language: C++

#include<stdio.h>
#include<stdlib.h>
using namespace std;
const int LEN = 100000;//??????????????§??????
struct pp
{
	char name[10];
	int time;
} ;
pp P[LEN];
int head, tail, n;
void enqueue(struct pp x)//??\????????°
{
	P[tail] = x;//?°?x?????\??°????°?
	tail = tail + 1;//??¨?????????????????????????????????head=(tail + 1) % LEN??¶??´???????????????
}
struct pp dequeue()//???????????°
{
	struct pp x = P[head];//?°?head??????????????´????´?????????\??????x
	head = head + 1;
	return x;//????????????????´?
}

int main()
{
	int alltime=0;//?´??????¶??´  ?±???¨????????????????§????
	int n, q;//n??¨???????????°???q??¨?????¶??´????????§?°?
	struct pp u;
	scanf("%d%d",&n,&q);
	//?°?????????????????????°?????????
	for (int i = 0; i < n; i++)
	{
		scanf("%s%d",& P[i].name,& P[i].time);//cin >> P[i].name >> P[i].time;
	}
	head = 0; tail = n;
	//?¨??????¶??´????????¬???
	while (head != tail)
	{
		u = dequeue();//?????´????´???????
		int c = min(q, u.time);//????????¶??´????????§?°??????\????????????????????¶??´
		u.time = u.time - q;//????????????????????????????????¶??´
		alltime = alltime + c;
		if (u.time > 0)
			enqueue(u);//??????????????¬????????\??°????°?
		else
		{
			printf("%s %d\n",u.name,alltime);
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:25: error: 'min' was not declared in this scope; did you mean 'main'?
   40 |                 int c = min(q, u.time);//????????¶??´????????§?°??????\????????????????????¶??´
      |                         ^~~
      |                         main
Language: C++

#include <algorithm>
#include <iostream>
using namespace std;
static const int MAX = 100001;

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

struct task que[MAX];
int head = 0;
int tail = 0;

int increment(int p) { return (p + 1) % MAX; }

void enqueue(struct task t) {
  que[tail] = t;
  tail = increment(tail);
}

struct task dequeue() {
  int pre = head;
  head = increment(head);
  return que[pre];
}

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

int main() {
  int n, q;
  cin >> n;
  cin >> q;
  struct task t;
  for (int i = 0; i < n; i++) {
    cin >> t.name;
    cin >> t.time;
    enqueue(t);
  }

  int elaps;
  int total = 0;
  while (!isEmpty()) {
    t = dequeue();
    elaps = min(t.time, q);
    t.time -= elaps;
    total += elaps;
    if (t.time > 0) {
      enqueue(t);
    } else {
      cout << t.name << " ";
      cout << total << endl;
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:54:4: error: expected '}' at end of input
   54 |   }
      |    ^
a.cc:30:12: note: to match this '{'
   30 | int main() {
      |            ^
Language: C++

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

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

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

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

int main(){
	time = 0;
	P u;
	int n,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;
	rest = 0;
	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:6:5: error: 'int time' redeclared as different kind of entity
    6 | 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: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:24:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   24 |         return x;
      |                ^
a.cc: In function 'int roundrobin(int, int)':
a.cc:28:17: error: expected primary-expression before ')' token
   28 |         if (q > ){
      |                 ^
a.cc:29:22: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   29 |                 time += q;
      |                 ~~~~~^~~~
a.cc:29:22: error: assignment of read-only location 'time'
a.cc:33:22: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   33 |                 time += rest;
      |                 ~~~~~^~~~~~~
a.cc:33:22: error: assignment of read-only location 'time'
a.cc: In function 'int main()':
a.cc:40:14: error: assignment of function 'time_t time(time_t*)'
   40 |         time = 0;
      |         ~~~~~^~~
a.cc:43:9: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
   43 |         scnaf("%d", &n);
      |         ^~~~~
      |         scanf
a.cc:49:9: error: 'rest' was not declared in this scope
   49 |         rest = 0;
      |         ^~~~
a.cc:52:21: error: 'decueue' was not declared in this scope; did you mean 'dequeue'?
   52 |                 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,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 n,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