Language: C++

#include <iostream>
#include <string>

struct List{
    int value[1000000];
    int next[1000000];
    int prev[1000000];
    int head = -1;
    int tail = -1;
    int idx = 0;
    
    void insertion(int x){
        next[idx] = head;
        prev[head] = idx;
        if(tail==-1){
            tail = idx;
        }
        value[idx] = x;
        head = idx;
        idx++;
    }

    int serch(int x){
        int j = head;
        while(j!=-1){
            if(value[j]==x){
                return j;
            }
            j = next[j];
        }
        return -1;
    }

    void deleteFirst(){
        if(next[head]==-1){
            head = -1;
            tail = -1:
        }else{
            head = next[head];
            prev[head] = -1;
        }
    }

    void deleteLast(){
        if(prev[tile]==-1){
            head = -1;
            tail = -1;
        }else{
            tail = prev[tail];
            next[tail] = -1;
        }
    }

    void del(int x){
        int s = serch(x);
        if(s!=-1){
            if(s==head){
                deleteFirst();
            }else if(s==tail){
                deleteLast();
            }else{
                int n = next[s];
                int p = prev[s];
                next[p] = n;
                prev[n] = p;
            }
        }
    }

    void command(std::string str){
        if(str[0]=="i"){
            int x;
            std::cin >> x;
            insertion(x);
        }
        if(str[0]=="d" && str[6]=="\0"){
            int x;
            std::cin >> x;
            del(x);
        }
        if(str[0]=="d" && str[6]=="F"){
            deleteFirst();
        }
        if(str[0]=="d" && str[6]=="L"){
            deleteLast();
        }
    }

    void print(){
        int k = head;
        while(k!=-1){
            std::cout << value[k];
            k = next[k];
            if(k!=-1){
                std::cout << " ";
            }
        }
        std::cout << "\n";
    }
};


int main(){
    List lst;
    int n;
    std::cin >> n;
    for(int i=0;i<n;i++){
        std::string str;
        std::cin >> str;
        lst.command(str);
    }
    lst.print();
    return 0;
}


Compiler output:
a.cc: In member function 'void List::deleteFirst()':
a.cc:37:22: error: expected ';' before ':' token
   37 |             tail = -1:
      |                      ^
a.cc: In member function 'void List::deleteLast()':
a.cc:45:17: error: 'tile' was not declared in this scope; did you mean 'time'?
   45 |         if(prev[tile]==-1){
      |                 ^~~~
      |                 time
a.cc: In member function 'void List::command(std::string)':
a.cc:71:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   71 |         if(str[0]=="i"){
a.cc:76:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   76 |         if(str[0]=="d" && str[6]=="\0"){
a.cc:76:33: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   76 |         if(str[0]=="d" && str[6]=="\0"){
a.cc:81:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   81 |         if(str[0]=="d" && str[6]=="F"){
a.cc:81:33: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   81 |         if(str[0]=="d" && str[6]=="F"){
a.cc:84:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   84 |         if(str[0]=="d" && str[6]=="L"){
a.cc:84:33: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   84 |         if(str[0]=="d" && str[6]=="L"){