Language: C++

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

int main()
{
  int n;
  int q;
  int time_cnt=0;
  queue<string> name;
  queue<int> time;
  string name1[100];
  int time1[100];
  string k_name;
  int k_time;

  std::cin>>n>>q;

  for(int i=0; i<n; i++){
    std::cin>>name1[i]>>time1[i];
    name.push(name1[i]);
    time.push(time1[i]);
  }

  while(name.size!=0){
    if(time2.front<=q){
      time_cnt+=time2.front();
      std::cout<<name1.front()<<" "<<time_cnt<<'\n';
      name.pop();
      time.pop();
    }else{
      time.front()-=q;
      time_cnt+=q;
      k_name=name.front();
      k_data=time.front();
      name.pop();
      time.pop();
      name.push(k_name);
      time.push(k_time);
    }
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'queue' was not declared in this scope; did you mean 'std::queue'?
   10 |   queue<string> name;
      |   ^~~~~
      |   std::queue
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_queue.h:96:11: note: 'std::queue' declared here
   96 |     class queue
      |           ^~~~~
a.cc:10:9: error: 'string' was not declared in this scope
   10 |   queue<string> name;
      |         ^~~~~~
a.cc:10:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:10:17: error: 'name' was not declared in this scope; did you mean 'tzname'?
   10 |   queue<string> name;
      |                 ^~~~
      |                 tzname
a.cc:11:9: error: expected primary-expression before 'int'
   11 |   queue<int> time;
      |         ^~~
a.cc:12:9: error: expected ';' before 'name1'
   12 |   string name1[100];
      |         ^~~~~~
      |         ;
a.cc:14:9: error: expected ';' before 'k_name'
   14 |   string k_name;
      |         ^~~~~~~
      |         ;
a.cc:20:15: error: 'name1' was not declared in this scope
   20 |     std::cin>>name1[i]>>time1[i];
      |               ^~~~~
a.cc:22:10: error: request for member 'push' in 'time', which is of non-class type 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'}
   22 |     time.push(time1[i]);
      |          ^~~~
a.cc:26:8: error: 'time2' was not declared in this scope; did you mean 'time1'?
   26 |     if(time2.front<=q){
      |        ^~~~~
      |        time1
a.cc:28:18: error: 'name1' was not declared in this scope
   28 |       std::cout<<name1.front()<<" "<<time_cnt<<'\n';
      |                  ^~~~~
a.cc:30:12: error: request for member 'pop' in 'time', which is of non-class type 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'}
   30 |       time.pop();
      |            ^~~
a.cc:32:12: error: request for member 'front' in 'time', which is of non-class type 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'}
   32 |       time.front()-=q;
      |            ^~~~~
a.cc:34:7: error: 'k_name' was not declared in this scope; did you mean 'k_time'?
   34 |       k_name=name.front();
      |       ^~~~~~
      |       k_time
a.cc:35:7: error: 'k_data' was not declared in this scope
   35 |       k_data=time.front();
      |       ^~~~~~
a.cc:35:19: error: request for member 'front' in 'time', which is of non-class type 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'}
   35 |       k_data=time.front();
      |                   ^~~~~
a.cc:37:12: error: request for member 'pop' in 'time', which is of non-class type 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'}
   37 |       time.pop();
      |            ^~~
a.cc:39:12: error: request for member 'push' in 'time', which is of non-class type 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'}
   39 |       time.push(k_time);
      |            ^~~~