Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i=0;i<(n);i++)
typedef long long ll;
using namespace std;

int main() {
  char s;
  cin >> s;
  deque<char> deq;
  deq.push_back(s);
  int q;
  cin >> q;
  bool total_rev = false;
  int t;
  int f;
  string c;
  rep(i, q) {
    cin >> t;
    if (t == 1) {
      total_rev = !total_rev;
    } else {
      cin >> f;
      cin >> c;
      if (total_rev) {
        if (f == 2) {
          deq.push_front(c)
        } else {
          deq.push_back(c)
        }
      } else {
        if (f == 1) {
          deq.push_front(c)
        } else {
          deq.push_back(c)
        }
      }
      
    }
  }
  if (total_rev) {
    reverse(s.begin(), s.end());
  }
  
  cout << s << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: no matching function for call to 'std::deque<char>::push_front(std::string&)'
   26 |           deq.push_front(c)
      |           ~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/deque:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:139,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_deque.h:1501:7: note: candidate: 'void std::deque<_Tp, _Alloc>::push_front(const value_type&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]'
 1501 |       push_front(const value_type& __x)
      |       ^~~~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:1501:36: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::deque<char>::value_type&' {aka 'const char&'}
 1501 |       push_front(const value_type& __x)
      |                  ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_deque.h:1516:7: note: candidate: 'void std::deque<_Tp, _Alloc>::push_front(value_type&&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]'
 1516 |       push_front(value_type&& __x)
      |       ^~~~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:1516:31: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::deque<char>::value_type&&' {aka 'char&&'}
 1516 |       push_front(value_type&& __x)
      |                  ~~~~~~~~~~~~~^~~
a.cc:28:24: error: no matching function for call to 'std::deque<char>::push_back(std::string&)'
   28 |           deq.push_back(c)
      |           ~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_deque.h:1538:7: note: candidate: 'void std::deque<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]'
 1538 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:1538:35: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::deque<char>::value_type&' {aka 'const char&'}
 1538 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_deque.h:1553:7: note: candidate: 'void std::deque<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]'
 1553 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:1553:30: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::deque<char>::value_type&&' {aka 'char&&'}
 1553 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:32:25: error: no matching function for call to 'std::deque<char>::push_front(std::string&)'
   32 |           deq.push_front(c)
      |           ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_deque.h:1501:7: note: candidate: 'void std::deque<_Tp, _Alloc>::push_front(const value_type&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]'
 1501 |       push_front(const value_type& __x)
      |       ^~~~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:1501:36: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::deque<char>::value_type&' {aka 'const char&'}
 1501 |       push_front(const value_type& __x)
      |                  ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_deque.h:1516:7: note: candidate: 'void std::deque<_Tp, _Alloc>::push_front(value_type&&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]'
 1516 |       push_front(value_type&& __x)
      |       ^~~~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:1516:31: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::deque<char>::value_type&&' {aka 'char&&'}
 1516 |       push_front(value_type&& __x)
      |                  ~~~~~~~~~~~~~^~~
a.cc:34:24: error: no matching function for call to 'std::deque<char>::push_back(std::string&)'
   34 |           deq.push_back(c)
      |           ~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_deque.h:1538:7: note: candidate: 'void std::deque<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]'
 1538 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:1538:35: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::deque<char>::value_type&' {aka 'const char&'}
 1538 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_deque.h:1553:7: note: candidate: 'void std::deque<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]'
 1553 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:1553:30: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::deque<char>::value_type&&' {aka 'char&&'}
 1553 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:41:15: error: request for member 'begin' in 's', which is of non-class type 'char'
   41 |     reverse(s.begin(), s.end());
      |               ^~~~~
a.cc:41:26: error: request for member 'end' in 's', which is of non-class type 'char'
   41 |     reverse(s.begin(), s.end());
      |                          ^~~