Language: C++

#include <sstream>
#include <cstring>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iterator>
#include <numeric>
#include <functional>
#include <climits>



using namespace std;
typedef unsigned long long ull;
typedef long long ll;

class node{
public:
  node* p;
  auto_ptr<node> n;
  int v;
  bool null;
  node(node* p_, node* n_, int v_): p(p_), n(n_), v(v_), null(false){}
  node(node* p_, node* n_): p(p_), n(n_), null(true){}
  ~node(){
    //cerr << "deleted: " << v  <<endl;
  }
};

class list{
public:
  auto_ptr<node> f;
  node* l;
  list(): f(new node(NULL, NULL)), l(new node(NULL, NULL)){
    f->n.reset(l);
    l->p = f.get();
  }
  void insert(int v){
    node* p = f.get();
    node* n = f->n.release();
    f->n.reset(new node(p, n, v));
    n->p = f->n.get();
  }
  void del(node* pos){
    if(pos == NULL) return;
    node* pre = pos->p;
    node* next = pos->n.release();
    pre->n.reset(next);
    next->p = pre;
  }
  node* find(int x){
    for(node* cur = f->n.get(); cur != l; cur = cur->n.get()){
      if(cur->v == x) return cur;
    }
    return NULL;
  }
  bool empty(){
    return f->n.get() == l;
  }
  void delf(){
    if(empty()) return;
    del(f->n.get());
  }
  void dell(){
    if(empty()) return;
    del(l->p);
  }
  void print(){
    vector<int> buf;
    for(node* cur = f->n.get(); cur != l; cur = cur->n.get()){
      buf.push_back(cur->v);
    }
    for (size_t i = 0; i < buf.size()-1; i++) {
      cout << buf[i] << " ";
    }
    cout << buf.back() << endl;
  }
};

int main(int argc, char *argv[]){
  size_t n;
  cin >> n;
  list l;
  for (size_t i = 0; i < n; i++) {
    string buf;
    cin >> buf;
    if(buf == "deleteFirst"){
      l.delf();
    } else if(buf == "deleteLast"){
      l.dell();
    } else if(buf == "insert"){
      cin >> buf;
      l.insert(atoi(buf.c_str()));
    } else if(buf == "delete"){
      cin >> buf;
      node* p = l.find(atoi(buf.c_str()));
      l.del(p);
    }
  }
  l.print();
  return 0;
}

Compiler output:
a.cc:30:3: error: 'auto_ptr' does not name a type
   30 |   auto_ptr<node> n;
      |   ^~~~~~~~
a.cc: In constructor 'node::node(node*, node*, int)':
a.cc:33:44: error: class 'node' does not have any field named 'n'
   33 |   node(node* p_, node* n_, int v_): p(p_), n(n_), v(v_), null(false){}
      |                                            ^
a.cc: In constructor 'node::node(node*, node*)':
a.cc:34:36: error: class 'node' does not have any field named 'n'
   34 |   node(node* p_, node* n_): p(p_), n(n_), null(true){}
      |                                    ^
a.cc: At global scope:
a.cc:42:3: error: 'auto_ptr' does not name a type
   42 |   auto_ptr<node> f;
      |   ^~~~~~~~
a.cc: In constructor 'list::list()':
a.cc:44:11: error: class 'list' does not have any field named 'f'
   44 |   list(): f(new node(NULL, NULL)), l(new node(NULL, NULL)){
      |           ^
a.cc:45:5: error: 'f' was not declared in this scope
   45 |     f->n.reset(l);
      |     ^
a.cc: In member function 'void list::insert(int)':
a.cc:49:15: error: 'f' was not declared in this scope
   49 |     node* p = f.get();
      |               ^
a.cc: In member function 'void list::del(node*)':
a.cc:57:23: error: 'class node' has no member named 'n'
   57 |     node* next = pos->n.release();
      |                       ^
a.cc:58:10: error: 'class node' has no member named 'n'
   58 |     pre->n.reset(next);
      |          ^
a.cc: In member function 'node* list::find(int)':
a.cc:62:21: error: 'f' was not declared in this scope
   62 |     for(node* cur = f->n.get(); cur != l; cur = cur->n.get()){
      |                     ^
a.cc:62:54: error: 'class node' has no member named 'n'
   62 |     for(node* cur = f->n.get(); cur != l; cur = cur->n.get()){
      |                                                      ^
a.cc: In member function 'bool list::empty()':
a.cc:68:12: error: 'f' was not declared in this scope
   68 |     return f->n.get() == l;
      |            ^
a.cc: In member function 'void list::delf()':
a.cc:72:9: error: 'f' was not declared in this scope
   72 |     del(f->n.get());
      |         ^
a.cc: In member function 'void list::print()':
a.cc:80:21: error: 'f' was not declared in this scope
   80 |     for(node* cur = f->n.get(); cur != l; cur = cur->n.get()){
      |                     ^
a.cc:80:54: error: 'class node' has no member named 'n'
   80 |     for(node* cur = f->n.get(); cur != l; cur = cur->n.get()){
      |                                                      ^