Language: C++

#include <iostream>
#include <list>
#include <string>
using namespace std;
 
class Task {
public:
  void input() {
    cin >> name >> time;
  }
  string name;
  int time;
};
 
int main() {
  int n, q;
  list<Task> tasks;
 
  cin >> n >> q;
  for (int i=0; i<n; i++) {
    auto task = Task;
    task.input();
    tasks.push_back(task);
  }
 
  list<Task>::iterator current;
  int time = 0;
 
  while ((current = tasks.begin()) != tasks.end()) {
    if (current->time > 100) {
      current->time -= 100;
      tasks.splice(tasks.end, tasks, current);
    } else {
      cout << current->name << current->time << endl;
    }
    tasks.erase(current);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: expected primary-expression before ';' token
   21 |     auto task = Task;
      |                     ^
a.cc:32:19: error: no matching function for call to 'std::__cxx11::list<Task>::splice(<unresolved overloaded function type>, std::__cxx11::list<Task>&, std::__cxx11::list<Task>::iterator&)'
   32 |       tasks.splice(tasks.end, tasks, current);
      |       ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/list:65,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_list.h:1621:7: note: candidate: 'void std::__cxx11::list<_Tp, _Alloc>::splice(const_iterator, std::__cxx11::list<_Tp, _Alloc>&&) [with _Tp = Task; _Alloc = std::allocator<Task>; const_iterator = std::__cxx11::list<Task>::const_iterator]'
 1621 |       splice(const_iterator __position, list&& __x) noexcept
      |       ^~~~~~
/usr/include/c++/14/bits/stl_list.h:1621:7: note:   candidate expects 2 arguments, 3 provided
/usr/include/c++/14/bits/stl_list.h:1640:7: note: candidate: 'void std::__cxx11::list<_Tp, _Alloc>::splice(const_iterator, std::__cxx11::list<_Tp, _Alloc>&) [with _Tp = Task; _Alloc = std::allocator<Task>; const_iterator = std::__cxx11::list<Task>::const_iterator]'
 1640 |       splice(const_iterator __position, list& __x) noexcept
      |       ^~~~~~
/usr/include/c++/14/bits/stl_list.h:1640:7: note:   candidate expects 2 arguments, 3 provided
/usr/include/c++/14/bits/stl_list.h:1656:7: note: candidate: 'void std::__cxx11::list<_Tp, _Alloc>::splice(const_iterator, std::__cxx11::list<_Tp, _Alloc>&&, const_iterator) [with _Tp = Task; _Alloc = std::allocator<Task>; const_iterator = std::__cxx11::list<Task>::const_iterator]'
 1656 |       splice(const_iterator __position, list&& __x, const_iterator __i) noexcept
      |       ^~~~~~
/usr/include/c++/14/bits/stl_list.h:1656:29: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::__cxx11::list<Task>::const_iterator'
 1656 |       splice(const_iterator __position, list&& __x, const_iterator __i) noexcept
      |              ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_list.h:1698:7: note: candidate: 'void std::__cxx11::list<_Tp, _Alloc>::splice(const_iterator, std::__cxx11::list<_Tp, _Alloc>&, const_iterator) [with _Tp = Task; _Alloc = std::allocator<Task>; const_iterator = std::__cxx11::list<Task>::const_iterator]'
 1698 |       splice(const_iterator __position, list& __x, const_iterator __i) noexcept
      |       ^~~~~~
/usr/include/c++/14/bits/stl_list.h:1698:29: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::__cxx11::list<Task>::const_iterator'
 1698 |       splice(const_iterator __position, list& __x, const_iterator __i) noexcept
      |              ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_list.h:1717:7: note: candidate: 'void std::__cxx11::list<_Tp, _Alloc>::splice(const_iterator, std::__cxx11::list<_Tp, _Alloc>&&, const_iterator, const_iterator) [with _Tp = Task; _Alloc = std::allocator<Task>; const_iterator = std::__cxx11::list<Task>::const_iterator]'
 1717 |       splice(const_iterator __position, list&& __x, const_iterator __first,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_list.h:1717:7: note:   candidate expects 4 arguments, 3 provided
/usr/include/c++/14/bits/stl_list.h:1767:7: note: candidate: 'void std::__cxx11::list<_Tp, _Alloc>::splice(const_iterator, std::__cxx11::list<_Tp, _Alloc>&, const_iterator, const_iterator) [with _Tp = Task; _Alloc = std::allocator<Task>; const_iterator = std::__cxx11::list<Task>::const_iterator]'
 1767 |       splice(const_iterator __position, list& __x, const_iterator __first,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_list.h:1767:7: note:   candidate expects 4 arguments, 3 provided