criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>

struct Node{
  int key;
  Node *next,*prev;
};
Node *nil;
Node* listSearch(int key){
  Node *cur=nil->next;
  while(cur!=nil&&cur->key!=key){
    cur=cur->next;
  }
  return cur;
}
void init(){
  nil=(Node *)malloc(sizeof(Node));
  nil->next=nil;
  nil->prev=nil;
}
void printList(){
  Node *cur=nil->next;
  int isf=0;
  while(1){
    if(cur==nil)break;
    if(isf++ > 0)printf(" ");
    printf("%d",cur->key);
    cur=cur->next;
  }
  printf("\n");
}
void deleteNode(Node *t){
  if(t==nil)return;
  t->prev->next=t->next;
  t->next->prev=t->prev;
  free(t);
}
void deleteFirst(){
  deleteNode(nil->next);
}
void deleteLast(){
  deleteNode(nil->prev);
}
void deleteKey(int key){
  deleteNode(listSearch(key));
}

void insert(int key){
  Node *x=(Node *)malloc(sizeof(Node));
  x->key=key;
  x->next=nil->next;
  nil->next=x;
  x->prev=nil;
}

int main(){
  int key,n,i;
  int size=0;
  char com[20];
  int np=0;
  int nd=0;
  scanf("%d",&n);
  init();
  for(i=0;i<n;i++){
    scanf("%s%d",com,&key);
    if(com[0]=='i'){
      insert(key);
      np++;
      size++;
    }
    else if(com[0]=='d'){
      if(strlen(com)>6){
        if(com(6)=='F')deleteFirst();
        else if(com[6]=='L')deleteLast();
      }
      else{
        deleteKey(key);
        nd++;
      }
      size--;
    }
  }
  printList();
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:15: error: 'com' cannot be used as a function
   74 |         if(com(6)=='F')deleteFirst();
      |            ~~~^~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>

struct Node{
  int key;
  Node *next,*prev;
};
Node *nil;
Node* listSearch(int key){
  Node *cur=nil->next;
  while(cur!=nil&&cur->key!=key){
    cur=cur->next;
  }
  return cur;
}
void init(){
  nil=(Node *)malloc(sizeof(Node));
  nil->next=nil;
  nil->prev=nil;
}
void printList(){
  Node *cur=nil->next;
  int isf=0;
  while(1){
    if(cur==nil)break;
    if(isf++ > 0)printf(" ");
    printf("%d",cur->key);
    cur=cur->next;
  }
  printf("\n");
}
void deleteNode(Node *t){
  if(t==nil)return;
  t->prev->next=t->next;
  t->next->prev=t->prev;
  free(t);
}
void deleteFirst(){
  deleteNode(nil->next);
}
void deleteLast(){
  deleteNode(nil->prev);
}
void deleteKey(int key){
  deleteNode(listSearch(key));
}

void insert(int key){
  Node *x=(Node *)malloc(sizeof(Node));
  x->key=key;
  x->next=nil->next;
  nil->next->prev=x;
  nil->next=x;
  x->prev=nil;
}

int main(){
  int key,n,i;
  int size=0;
  char com[20];
  int np=0;
  int nd=0;
  scanf("%d",&n);
  init();
  for(i=0;i<n;i++){
    scanf("%s%d",com,&key);
    if(com[0]=='i'){
      insert(key);
      np++;
      size++;
    }
    else if(com[0]=='d'){
      if(strlen(com)>6){
        if(com(6)=='F')deleteFirst();
        else if(com[6]=='L')deleteLast();
      }
      else{
        deleteKey(key);
        nd++;
      }
      size--;
    }
  }
  printList();
  return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:75:15: error: 'com' cannot be used as a function
   75 |         if(com(6)=='F')deleteFirst();
      |            ~~~^~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>

struct Node{
  int key;
  Node *next,*prev;
};
Node *nil;
Node* listSearch(int key){
  Node *cur=nil->next;
  while(cur!=nil&&cur->key!=key){
    cur=cur->next;
  }
  return cur;
}
void init(){
  nil=(Node *)malloc(sizeof(Node));
  nil->next=nil;
  nil->prev=nil;
}
void printList(){
  Node *cur=nil->next;
  int isf=0;
  while(1){
    if(cur==nil)break;
    if(isf++ > 0)printf(" ");
    printf("%d",cur->key);
    cur=cur->next;
  }
  printf("\n");
}
void deleteNode(Node *t){
  if(t==nil)return;
  t->prev->next=t->next;
  t->next->prev=t->prev;
  free(t);
}
void deleteFirst(){
  deleteNode(nil->next);
}
void deleteLast(){
  deleteNode(nil->prev);
}
void deleteKey(int key){
  deleteNode(listSearch(key));
}

void insert(int key){
  Node *x=(Node *)malloc(sizeof(Node));
  x->key=key;
  x->next=nil->next;
  nil->next->prev=x;
  nil->next=x;
  x->prev=nil;
}

int main(){
  int key,n,i;
  int size=0;
  char com[20];
  int np=0;
  int nd=0;
  scanf("%d",&n);
  init();
  for(i=0;i<n;i++){
    scanf("%s%d",com,&key);
    if(com[0]=='i'){
      insert(key);
      np++;
      size++;
    }
    else if(com[0]=='d'){
      if(strlen(com)>6){
        if(com(6)=='F')deleteFirst();
        else if(com[6]=='L')deleteLast();
      }
      else{
        deleteKey(key);
        nd++;
      }
      size--;
    }
  }
  printList();
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:15: error: 'com' cannot be used as a function
   75 |         if(com(6)=='F')deleteFirst();
      |            ~~~^~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>

struct Node{
  int key;
  Node *next,*prev;
};

Node *nil;

Node* listSearch(int key){
  Node *cur=nil->next;
  while(cur!=nil&&cur->key!=key){
    cur=cur->next;
  }
  return cur;
}

void init(){
  nil=(Node *)malloc(sizeof(Node));
  nil->next=nil;
  nil->prev=nil;
}

void printList(){
  Node *cur=nil->next;
  int isf=0;
  while(1){
    if(cur==nil)break;
    if(isf++ > 0)printf(" ");
    printf("%d",cur->key);
    cur=cur->next;
  }
  printf("\n");
}

void deleteNode(Node *t){
  if(t==nil)return;
  t->prev->next=t->next;
  t->next->prev=t->prev;
  free(t);
}
void deleteFirst(){
  deleteNode(nil->next);
}
void deleteLast(){
  deleteNode(nil->prev);
}
void deleteKey(int key){
  deleteNode(listSearch(key));
}

void insert(int key){
  Node *x=(Node *)malloc(sizeof(Node));
  x->key=key;
  x->next=nil->next;
  nil->next->prev=x;
  nil->next=x;
  x->prev=nil;
}

int main(){
  int key,n,i;
  int size=0;
  char com[20];
  int np=0;
  int nd=0;
  scanf("%d",&n);
  init();
  for(i=0;i<n;i++){
    scanf("%s%d",com,&key);
    if(com[0]=='i'){
      insert(key);
      np++;
      size++;
    }
    else if(com[0]=='d'){
      if(strlen(com)>6){
        if(com(6)=='F')deleteFirst();
        else if(com[6]=='L')deleteLast();
      }
      else{
        deleteKey(key);
        nd++;
      }
      size--;
    }
  }
  printList();
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:15: error: 'com' cannot be used as a function
   80 |         if(com(6)=='F')deleteFirst();
      |            ~~~^~~
Language: C++

#include<iostream>
#include<list>
#include<algorithm>
using namespace std;

int main(){
    int q, x;
    char command[20];
    list<int> v;
    cin >> q;
    for(int i = 0; i < q; i++){
        cin >> command;
        if(command == 'insert'){
            cin >> x;
            v.push_front(x);
        }else if(command == 'deleteLast'){
            v.pop_back();
        }else if(command == 'deleteFirst'){
            v.pop_front();
        }else if(command == 'delete'){
            cin >> x;
            for(list<int>::iterator it = v.begin(); it != v.end(); it++){
                if( *it == x ){
                    v.erase(it);
                    break;
                }
            }
        }
    }
    int i = 0;
    for(list<int>::iterator it = v.begin(); it != v.end(); it++){
        if( i++ ) cout << " ";
        cout << *it;
    }
    cout << endl;
}

Compiler output:
a.cc:13:23: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   13 |         if(command == 'insert'){
      |                       ^~~~~~~~
a.cc:16:29: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
   16 |         }else if(command == 'deleteLast'){
      |                             ^~~~~~~~~~~~
a.cc:18:29: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
   18 |         }else if(command == 'deleteFirst'){
      |                             ^~~~~~~~~~~~~
a.cc:20:29: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   20 |         }else if(command == 'delete'){
      |                             ^~~~~~~~
a.cc: In function 'int main()':
a.cc:13:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         if(command == 'insert'){
      |            ~~~~~~~~^~~~~~~~~~~
a.cc:16:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |         }else if(command == 'deleteLast'){
      |                  ~~~~~~~~^~~~~~~~~~~~~~~
a.cc:18:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |         }else if(command == 'deleteFirst'){
      |                  ~~~~~~~~^~~~~~~~~~~~~~~~
a.cc:20:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |         }else if(command == 'delete'){
      |                  ~~~~~~~~^~~~~~~~~~~
Language: C++

#include	<iostream>
#include	<deque>
#include	<string>

using namespace std;

int main()
{
	int		n;
	cin >> n;
	cin.clear();
	cin.ignore();

	deque<int>	dq;

	string		command;
	int			number;

	for (int i = 0; i < n; i++)
	{
		cin >> command;

		if (command == "insert")
		{
			cin >> number;
			dq.push_front(number);
		}
		else if (command == "delete")
		{
			cin >> number;
			auto it = find(begin(dq), end(dq), number);
			if (it != end(dq))
			{
				dq.erase(it);
			}
		}
		else if (command == "deleteFirst")
		{
			dq.pop_front();
		}
		else
		{
			//deleteLast
			dq.pop_back();
		}

		cin.clear();
		cin.ignore();
	}

	for (auto i = 0u; i < dq.size(); i++)
	{
		if (i != 0u)	cout << " ";
		cout << dq[i];
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:39: error: no matching function for call to 'find(std::deque<int>::iterator, std::deque<int>::iterator, int&)'
   31 |                         auto it = find(begin(dq), end(dq), number);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:31:39: note:   'std::_Deque_iterator<int, int&, int*>' is not derived from 'std::istreambuf_iterator<_CharT>'
   31 |                         auto it = find(begin(dq), end(dq), number);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>

typedef struct Node *PtrToNode;
typedef PtrToNode List;
typedef PtrToNode Position;
struct Node{
	int num;
	Position Next;
	Position Before;
};

void Insert(List L,int e)
{
	Position TmpCell;
	TmpCell=(Position)malloc(sizeof(struct Node));
	TmpCell->num=e;
	if(L->Next==L)
	{
		TmpCell->Next=L;
		TmpCell->Before=L
		L->Before=TmpCell;
	}
	else
	{
		TmpCell->Next=L->Next;
		TmpCell->Before=L;
	}
	L->Next=TmpCell;
}

void Delete(List L,int x)
{
	Position TmpCell=L;
	while((TmpCell->Next)!=L)
	{
		Position t=TmpCell->Next;
		if((t->num)==x)
		{
			TmpCell->Next=t->Next;
			t->Next->Before=TmpCell;
			break;
		}
		TmpCell=t;
	}
}

void deleteFirst(List L)
{
	Position t=L->Next;
	L->Next=t->Next;
	t->Next->Before=L;
}

void deleteLast(List L)
{
	
	L->Before->Before->Next=L;
//	Position TmpCell=L,t;
//	while(TmpCell->Next!=NULL)
//	{
//		t=TmpCell;//上一个 
//		TmpCell=TmpCell->Next;//最后一个
//	}
//	t->Next=NULL;	
}

void printList(List L)
{
	Position TmpCell=L;
	while(TmpCell->Next!=L)
	{
		Position t=TmpCell->Next;
		printf("%d",t->num);
		if(t->Next!=L)
			printf(" ");
		TmpCell=t;
	}
	printf("\n");
}
int main()
{
	int n;
	scanf("%d",&n);
	char op[15];
	int e;
	List L=(Position)malloc(sizeof(struct Node));
	L->num=-1;
	L->Next=L->Before=L;
	for(int i=0;i<n;i++)
	{
		scanf("%s",op);
		if(strcmp(op,"insert")==0)
		{
			scanf("%d",&e);
			Insert(L,e);
		}
		else if(strcmp(op,"delete")==0)
		{
			scanf("%d",&e);
			Delete(L,e);
		}
		else if(strcmp(op,"deleteFirst")==0)deleteFirst(L);
		else if(strcmp(op,"deleteLast")==0)deleteLast(L);
	}
	printList(L);
	return 0;
}

Compiler output:
a.cc: In function 'void Insert(List, int)':
a.cc:22:34: error: expected ';' before 'L'
   22 |                 TmpCell->Before=L
      |                                  ^
      |                                  ;
   23 |                 L->Before=TmpCell;
      |                 ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,b;
  list<int>a;
  cin>>n;
  string s;
  while(n--){
    cin>>s;
    if(s.size()<=6){
      cin>>b;
      if(s[0]=='i') a.push_front(b);
      else{
        list<int>::iterator it=a.begin();
        while(it!=a.end()){
          if(*it==b){a.erase(it);break;}
          it++;
        }
      }
    }
    else{
      if(s[6]=='F')a.pop_front();
      else a.pop_back();
    }
  }
  list<int>::iterator it=a.begin();
  for(int i=0;it!=a.end();it++,i++){
    if(i)cout<<' ';
    cout<<(*it);
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:30:4: error: expected '}' at end of input
   30 |   }
      |    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>

struct Node{
int key;
Node *next, *prev;
};
Node *nil;
Node* listSearch(int key){
Node *cur = nil->next;
while(cur != nil && cur->key !=key){
cur=cur->next;
}
return cur;
}
void init(){
nil =(Node *)malloc(sizeof(Node));
nil->next=nil;
nil->prev=nil;
}
void printlist(){
Node *cur=nil->next;
int isf=0;
while(1){
if (cur==nil)break;
if(isf++>0) printf(" ");
printf("%d",cur->next);
cur = cur->next;
}
printf("\n");
}
void deleteNode(Node *t){
if(t==nil) return;
t->prev->next = t->next;
t->next->prev = t->prev;
free(t);
}
void deleteFirst(){
deleteNode(nil->next);
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>

struct Node{
int key;
Node *next, *prev;
};
Node *nil;
Node* listSearch(int key){
Node *cur = nil->next;
while(cur != nil && cur->key !=key){
cur=cur->next;
}
return cur;
}
void init(){
nil =(Node *)malloc(sizeof(Node));
nil->next=nil;
nil->prev=nil;
}
void printlist(){
Node *cur=nil->next;
int isf=0;
while(1){
if (cur==nil)break;
if(isf++>0) printf(" ");
printf("%d",cur->next);
cur = cur->next;
}
printf("\n");
}
void deleteNode(Node *t){
if(t==nil) return;
t->prev->next = t->next;
t->next->prev = t->prev;
free(t);
}
void deleteFirst(){
deleteNode(nil->next);
}
void deleteLast(){
deleteNode(nil->prev);
}
void deleteKey(int key){
deleteNode(listSearch(key));
}
void insert(int key){
Node *x=(Node *)malloc(sizeof(Node));
x->key=key;
x->next=nil->next;
nil->next->prev=x;
nil->next=x;
x->prev=nil;
}
int main(){
int key,n,i;
int size =0;
char com[20];
int np=0,nd=0;
scanf("%d",&n);
init();
for(i=0;i<n;i++){
scanf("%s%d",com,&key);
if(com[0]=='i') {insert(key);np++;size++;}
else if(com[0]=='d') {
if(strlen(com)>6){
if(com[6]=='F') deleteFirst();
else if(com[6]=='L')deleteLast();
}
else
{
deleteKey(key); nd++;
}
size--;
}
}
printList();
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:78:1: error: 'printList' was not declared in this scope; did you mean 'printlist'?
   78 | printList();
      | ^~~~~~~~~
      | printlist
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<string.h>

struct node {
  unsigned int key;
  struct node *next;
  struct node *prev;
};

typedef struct node * NodePointer;

NodePointer nil;

NodePointer listSearch(int key) {
  NodePointer t;
  for (t = nil->next; t != nil; t = t->next) {
    if (t->key == key) {
      return t;
    }
  }
  return nil;
}

void init(void) {
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(void) {
  NodePointer cur = nil->next;
  int isf = 1;
  while(1) {
    if (cur == nil) break;
    if (isf == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");
}

void deleteNode(NodePointer t){
  NodePointer a_del = t->next, b_del = t->prev;
  if (a_del == nil) {
    nil->prev = b_del;
    b_del->next = nil;
  } else if (b_del == nil) {
    nil->next = a_del;
    a_del->prev = nil;
  } else {
    a_del->prev = b_del;
    b_del->next = a_del;
  }
  free(t);
}

void deleteFirst(void) {
  NodePointer t = nil->next;
  if (t == nil) return;
  deleteNode(t);
}

void deleteLast(void) {
  NodePointer t = nil->prev;
  if (t == nil) return;
  deleteNode(t);
}

void delete(int key) {
  NodePointer t = listSearch(key);
  if (t == nil) return;
  deleteNode(t);
}


void insert(int key) {
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key = key;

  if (nil->prev == NULL) {
    nil->prev = x;
  }
  
  if (nil->next == NULL) {
    nil->next = x;
    x->prev = nil;
    x->next = nil;
  } else {
    nil->next->prev = x;
    x->next = nil->next;
    x->prev = nil;
    nil->next = x;
  }  
}

int main(void) {
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);
  init();
  for (i = 0; i < n; i++) {
    scanf("%s%d", com, &key);
    if (com[0] == 'i') {
      insert(key); 
      np++; 
      size++;
    } else if (com[0] == 'd') {
      if (strlen(com) > 6) {
        if (com[6] == 'F') deleteFirst();
        else if (com[6] == 'L') deleteLast();
      } else {
        delete(key);
        nd++;
      }
      size--;
    }
  }

  printList();
  return 0;
}

Compiler output:
a.cc: In function 'void init()':
a.cc:26:15: error: invalid conversion from 'void*' to 'NodePointer' {aka 'node*'} [-fpermissive]
   26 |   nil = malloc(sizeof(struct node));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |               |
      |               void*
a.cc: At global scope:
a.cc:71:6: error: expected unqualified-id before 'delete'
   71 | void delete(int key) {
      |      ^~~~~~
a.cc: In function 'void insert(int)':
a.cc:80:13: error: invalid conversion from 'void*' to 'NodePointer' {aka 'node*'} [-fpermissive]
   80 |   x = malloc(sizeof(struct node));
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc: In function 'int main()':
a.cc:117:16: error: type 'int' argument given to 'delete', expected pointer
  117 |         delete(key);
      |               ~^~~~
Language: C++

#include< cstdio>
#include<cstdilb>
#include<cstring>
struct Node{
int key;
Node *next,*prev;
};
Node *nil;
Node* listSearch(int key)
{
    Node *cur=nil->next;
    while(cur!=nil&&cur->key!=key)
    {
      cur=cur->next;
    }
    return cur;
}
void init()
{
    nil=(Node*)malloc(sizeof(Node));
    nil->next=nil;
    nil->prev=nil;
}
void printfList()
{
    Node *cur=nil->next;
    int isf=0;
    while(1)
    {
        if(cur==nil) break;
        if(isf++>0) printf(" ");
        printf("%d",cur->key);
        cur=cur->next;
    }
    printf("\n");
}
void deleteNode(Node *t)
{
    if(t==nil) return ;
    t->prev->next=t->next;
    t->next->prev=t->prev;
    free(t);
}
void deleteFirst()
{
    deleteNode(nil->prve);
}
void deleveLast()
{
    deleveNode(nil->prev);
}
void deletekey(int key)
{
    deleteNode(listSreach(key));
}
 void insert(int key)
 {
     Node *x=(Node*) malloc(sizeof(Node));
     x->key=key;
     x->next =nil->next;
     nil->next->prev=x;
     nil->next=x;
     x->prev=nil;
 }
 int main()
{
    int key,n,i;
    int size=0;
    char com(20);
    int np=0,nd=0;
    scanf("&d",&n)
    init();
    for(i=0;i<n;i++)
    {
      scanf("%s%d",com,&key);
      if(com[0]=='i') {insert(key);np++;size++;}
       else if(com[0]=='d')
       {
           if(strlen(com)>6)
           {
               if(com[6]=='F') deleteFirst();
               else if(com[6]=='L') deleteLast();
           } else
       {
           deletekey(key);nd++;
       }
       size--;
       }
    }
    printfList();
    return 0;

}

Compiler output:
a.cc:1:9: fatal error:  cstdio: No such file or directory
    1 | #include< cstdio>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <ctype.h>

using namespace std;

void deleteX(list<int> &list, int x) {
    for(auto itr=list.begin(); itr!=list.end(); itr++ ) {
        if(*itr==x) {
            list.erase(itr);
            break;
        }
    }
}

bool tiny_match(const char* str, const char* ptn, int n, int* p_val) {
	if (strncmp(str, ptn, (size_t)n) == 0 && isspace(str[n])) {
		*p_val = atoi(&(str[n]));
		return true;
	} else {
		*p_val = 0;
		return false;
	}
};

#define MATCH(str, ptn, p)		(tiny_match((str), (ptn), sizeof(ptn) - (size_t)1, (p)))

int main(void) {
    list<int> list;
    int n;
    int x;
    
    string str;
    getline(cin,str);
    stringstream ss(str);

	ss >> n;

	while( n > 0 && getline(cin, str) ) {
		size_t head = str.find_first_not_of(" \t\v\r\n");
		if (head == std::string::npos) {
			return -1;
		}
		--n;
        
        if(MATCH(&(str[head]), "insert", &x)) {
            list.push_front(x);
        }
        else if(MATCH(&(str[head]), "delete", &x)) {
            deleteX(list, x);
        }
        else if(MATCH(&(str[head]), "deleteFirst", &x)) {
            list.pop_front();
        }
        else if(MATCH(&(str[head]), "deleteLast", &x)) {
            list.pop_back();
        }
    }

	//display list
    for(auto itr=list.begin(); itr!=list.end(); itr++ ) {
        if(itr==list.begin()) {
            cout << *itr;
        } else {
            cout << " " << *itr;
        }
    }
    cout << endl;

	return 0;
}

Compiler output:
a.cc: In function 'bool tiny_match(const char*, const char*, int, int*)':
a.cc:19:13: error: 'strncmp' was not declared in this scope
   19 |         if (strncmp(str, ptn, (size_t)n) == 0 && isspace(str[n])) {
      |             ^~~~~~~
a.cc:5:1: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <list>
  +++ |+#include <cstring>
    5 | #include <ctype.h>
a.cc:26:1: warning: control reaches end of non-void function [-Wreturn-type]
   26 | };
      | ^
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <string>
#include <utility>
#include <queue>

using namespace std;

struct Node {
	int key;
	Node *next, *prev;
};

Node *nil;

Node* listSearch(int key) {
	Node *cur = nil->next;
	while (cur != nil&&cur->key != key) {
		cur = cur->next;
	}
	return cur;
}

void init() {
	nil = (Node*)calloc(1, sizeof(Node));
	nil->next = nil;
	nil->prev = nil;
}

void printList() {
	Node *cur = nil->next;
	int isf = 0;
	while (1) {
		if (cur == nil) {
			break;
		}
		if (isf++ > 0) {
			printf(" ");
		}
		printf("%d", cur->key);
		cur = cur->next;
	}
	printf("\n");
}

void deleteNode(Node *t) {
	if (t == nil) {
		return;
	}
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}

void deleteFirst() {
	deleteNode(nil->next);
}

void deleteLast() {
	deleteNode(nil->prev);
}

void deleteKey(int key) {
	deleteNode(listSearch(key));
}

void insert(int key) {
	Node *x = (Node*)calloc(1, sizeof(Node));
	x->key = key;
	x->next = nil->next;
	nil->next->prev = x;
	nil->next = x;
	x->prev = nil;
}

int main() {
	int key, n, i;
	int size = 0;
	char com[20];
	int np = 0, nd = 0;
	scanf("%d", &n);
	init();
	for (i = 0; i < n; i++) {
		scanf("%s%d", com, &key);
		if (com[0] == 'i') {
			insert(key);
			np++;
			size++;
		}
		else if (com[0] == 'd') {
			if (strlen(com) > 6) {
				if (com[6] == 'F') {
					deleteFirst();
				}
				else if (com[6] == 'L') {
					deleteLast();
				}
			}
			else {
				deleteKey(key);
				nd++;
			}
			size--;
		}
	}

	printList();

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:95:29: error: 'strlen' was not declared in this scope
   95 |                         if (strlen(com) > 6) {
      |                             ^~~~~~
a.cc:10:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    9 | #include <queue>
  +++ |+#include <cstring>
   10 |
Language: C++

#include<iostream>
#include<cstdlib>
#include<fstream>
#include<cstring>
#include<cstdio>
#include<vector>
using namespace std;
#define	QUEUE_LENGTH 100005

typedef struct Node
{
	int key;
	Node *prev;
	Node *next;

};

Node *nil;
void init()
{
	nil = (Node *)malloc(sizeof(Node));
	nil->next = nil;
	nil->prev = nil;
}


void insert(int key)
{
	Node *tem = (Node *)malloc(sizeof(Node));
	tem->key = key;
	nil->next->prev = tem;
	tem->next= nil->next;
	tem->prev = nil;
	nil->next = tem;
}


void deleteNode(Node *t)
{
	if (t == nil) return;
	else
	{
		Node *prevNode = t->prev;
		Node *nextNode = t->next;
		prevNode->next = nextNode;
		nextNode->prev = prevNode;
		free(t);
	}
}

void deleteFirst()
{
	deleteNode(nil->next);
}
void deleteLast()
{
	deleteNode(nil->prev);
}

Node *search(int key)
{
	Node *cur = nil->next;
	while (cur != nil&&cur->key != key) cur = cur->next;
	if (cur == nil) return NULL;
	else return cur;
}

void printList()
{
	Node *cur = nil->next;
	while (cur->next != nil)
	{
		cout << cur->key << " ";
		cur = cur->next;
	}
	cout << cur->key<<endl;
}

int main()
{
	//fstream fcin;
	//fcin.open("test.txt");
	freopen("test.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	int totalNum;
	char oper[20];
	int key;
	init();
	//fcin >> totalNum;
	cin >> totalNum;
	for (int i = 0; i < totalNum; i++)
	{
		cin>>oper;
		//fcin >> oper >> key;
		if (oper[0] == 'i')
		{
			cin >> key;
			insert(key);
		}
		else if (oper[6] == 'F') deleteFirst();
		else if (oper[6] == 'L') deleteLast();
		else
		{
			cin >> key;
			Node *delNode = search(key);
			deleteNode(delNode);
		}
	}
	printList();

Compiler output:
a.cc:10:1: warning: 'typedef' was ignored in this declaration
   10 | typedef struct Node
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:109:21: error: expected '}' at end of input
  109 |         printList();
      |                     ^
a.cc:80:1: note: to match this '{'
   80 | {
      | ^
Language: C++

//
//  main.cpp
//  doubly_linked_list
//
//  Created by ???????????? on 2017/10/05.
//  Copyright ?? 2017 ????????????. All rights reserved.
//

#include <iostream>

using namespace std;

struct Node{
    int key;
    Node *prev, *next;
};

Node *nil;

void init(){
    nil = (Node *)malloc(sizeof(Node));
    nil -> next = nil;
    nil -> prev = nil;
}

void insert(int key){
    Node *x = (Node *)malloc(sizeof(Node));
    x->key = key;
    
    x->next = nil->next;
    nil->next->prev = x;
    nil->next = x;
    x->prev = nil;
}

Node* listSearch(int key){
    Node *cur = nil->next;
    while( cur != nil && cur-> key != key){
        cur = cur->next;
    }
    return cur;
}

void deleteNode(Node *t){
    t->prev->next = t->next;
    t->next->prev = t-> prev;
    free(t);
}

void deleteFirst(){
    deleteNode(nil->next);
}

void deleteLast(){
    deleteNode(nil->prev);
}

void printNodes(){
    Node *cur = nil->next;
    while( cur != nil ){
        cout << cur->key << " ";
        cur = cur-> next;
    }
    cout << endl;
}

int main(int argc, const char * argv[]) {
    init();
    int i, n, key;
    char action[10];
    scanf("%d", &n);
    
    for (i = 0; i < n; i++){
        scanf("%s %d", action, &key);
        if(action[0] == 'i'){
            insert(key);
        }
        else if(action[0] == 'd'){
            Node *t = listSearch(key);
            deleteNode(t);
        }
        else if(action[6] = 'F'){
            deleteFirst();
        }
        else if (action[6] = 'L'){
            deleteLast()
        }
    }
    printNodes();
    
//    std::cout << "Hello, World!\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:86:25: error: expected ';' before '}' token
   86 |             deleteLast()
      |                         ^
      |                         ;
   87 |         }
      |         ~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>

struct Node
{
    int key;
    Node *prev, *next;
};

Node *nil;

void init()
{
	nil=(Node *)malloc(sizeof(Node));
	nil->next = nil;
	nil->prev = nil;
}

void insert(int key)
{
	Node *x = (Node *)malloc(sizeof(Node));
	x->key = key;
	x->next = nil->next;
	nil->next->prev = x;
	x->prev = nil;
}

Node* listSearch(int key)
{
	Node *cur = nil->next;
	while(cur != nil && cur->key != key)
	{
		cur = cur->next;
	}
	return cur;
}

void deleteNode(Node *t)
{
	if(t == nil) return;
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}

void deleteFirst()
{
	deleteNode(nil->next);
}

void deleteLast()
{
	deleteNode(nil->prev);
}

void deleteKey(int key)
{
	deleteNode(listSearch(key));
}

void printList()
{
	Node *cur = nil->next;
	int i=0;
	while(1)
	{
		if( cur == nil ) break;
		if( i++ > 0 ) print(" ");
		printf("%d", cur->key);
		cur = cur->next;
	}
	print("\n");
}

main()
{
	int key, n, i;
	char com[12];
	
	scanf("%d",&n);
	init();
	for( i = 0 ; i <= n-1 ; i++ )
	{
		scanf("%s%d",com, &key);
		if( com[0] == 'i' ) insert(key);
		else
		{
			if(strlen(com) > 6)
			{
				if( com[6] == 'F' ) deleteFirst();
				else deleteLast();
			}
			else deleteKey(key);
		}
	}
	
	printList();

	return 0;
}

Compiler output:
a.cc: In function 'void printList()':
a.cc:69:31: error: 'print' was not declared in this scope; did you mean 'printf'?
   69 |                 if( i++ > 0 ) print(" ");
      |                               ^~~~~
      |                               printf
a.cc:73:9: error: 'print' was not declared in this scope; did you mean 'printf'?
   73 |         print("\n");
      |         ^~~~~
      |         printf
a.cc: At global scope:
a.cc:76:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   76 | main()
      | ^~~~
Language: C++

#include <cstdio.h>
#include <cstdlib.h>
#include <cstring.h>

struct Node
{
    int key;
    Node *prev, *next;
};

Node *nil;

void init()
{
	nil=(Node *)malloc(sizeof(Node));
	nil->next = nil;
	nil->prev = nil;
}

void insert(int key)
{
	Node *x = (Node *)malloc(sizeof(Node));
	x->key = key;
	x->next = nil->next;
	nil->next->prev = x;
	x->prev = nil;
}

Node* listSearch(int key)
{
	Node *cur = nil->next;
	while(cur != nil && cur->key != key)
	{
		cur = cur->next;
	}
	return cur;
}

void deleteNode(Node *t)
{
	if(t == nil) return;
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}

void deleteFirst()
{
	deleteNode(nil->next);
}

void deleteLast()
{
	deleteNode(nil->prev);
}

void deleteKey(int key)
{
	deleteNode(listSearch(key));
}

void printList()
{
	Node *cur = nil->next;
	int i=0;
	while(1)
	{
		if( cur == nil ) break;
		if( i++ > 0 ) printf(" ");
		printf("%d", cur->key);
		cur = cur->next;
	}
	printf("\n");
}

main()
{
	int key, n, i;
	char com[12];
	
	scanf("%d",&n);
	init();
	for( i = 0 ; i <= n-1 ; i++ )
	{
		scanf("%s%d",com, &key);
		if( com[0] == 'i' ) insert(key);
		else
		{
			if(strlen(com) > 6)
			{
				if( com[6] == 'F' ) deleteFirst();
				else deleteLast();
			}
			else deleteKey(key);
		}
	}
	
	printList();

	return 0;
}

Compiler output:
a.cc:1:10: fatal error: cstdio.h: No such file or directory
    1 | #include <cstdio.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<string>
using namespace std;

struct Node{
    int   key;
    Node* prev;
    Node* next;
};

class List{
    Node* nil;
    delete_(Node* n){
        n->prev->next = n->next;
        n->next->prev = n->prev;
        delete n;
    }
public:
    List(){
        nil = new Node;
        nil->prev = nil;
        nil->next = nil;
    }
    void insert_key(int key){
        Node* n = new Node;
        n->key = key;
        nil->next->prev = n;
        n->next = nil->next;
        nil->next = n;
        n->prev = nil;
    }
    void delete_key(int key){
        for (Node* n = nil->next; n != nil; n = n->next) {
            if (n->key == key) {
                delete_(n);
                return;
            }
        }
    }
    void print_all(){
        for (Node* n = nil->next; n != nil; n = n->next) {
            if (n != nil->next) cout << " ";
            cout << n->key;
        }
        cout << endl;
    }
    void deleteFirst(){
        delete_(nil->next);
    }
    void deleteLast(){
        delete_(nil->prev);
    }
};

int main(){
    int n;
    cin >> n;
    List l;
    for (int i = 0; i < n; i++) {
        string command;
        cin >> command;
        if (command == "deleteFirst") {
            l.deleteFirst();
            continue;
        }
        if (command == "deleteLast") {
            l.deleteLast();
            continue;
        }
        int key;
        cin >> key;
        if (command == "insert") {
            l.insert_key(key);
            continue;
        }
        if (command == "delete") {
            l.delete_key(key);
            continue;
        }
    }
    l.print_all();
    return 0;
}

Compiler output:
a.cc:13:5: error: ISO C++ forbids declaration of 'delete_' with no type [-fpermissive]
   13 |     delete_(Node* n){
      |     ^~~~~~~
a.cc: In member function 'int List::delete_(Node*)':
a.cc:17:5: warning: no return statement in function returning non-void [-Wreturn-type]
   17 |     }
      |     ^
Language: C++

#include<iostream>
#include<string>
using namespace std;

struct Node{
    int   key;
    Node* prev;
    Node* next;
};

class List{
    Node* nil;
    delete_node(Node* n){
        n->prev->next = n->next;
        n->next->prev = n->prev;
        delete n;
    }
public:
    List(){
        nil = new Node;
        nil->prev = nil;
        nil->next = nil;
    }
    void insert_key(int key){
        Node* n = new Node;
        n->key = key;
        nil->next->prev = n;
        n->next = nil->next;
        nil->next = n;
        n->prev = nil;
    }
    void delete_key(int key){
        for (Node* n = nil->next; n != nil; n = n->next) {
            if (n->key == key) {
                delete_node(n);
                return;
            }
        }
    }
    void print_all(){
        for (Node* n = nil->next; n != nil; n = n->next) {
            if (n != nil->next) cout << " ";
            cout << n->key;
        }
        cout << endl;
    }
    void deleteFirst(){
        delete_node(nil->next);
    }
    void deleteLast(){
        delete_node(nil->prev);
    }
};

int main(){
    int n;
    cin >> n;
    List l;
    for (int i = 0; i < n; i++) {
        string command;
        cin >> command;
        if (command == "deleteFirst") {
            l.deleteFirst();
            continue;
        }
        if (command == "deleteLast") {
            l.deleteLast();
            continue;
        }
        int key;
        cin >> key;
        if (command == "insert") {
            l.insert_key(key);
            continue;
        }
        if (command == "delete") {
            l.delete_key(key);
            continue;
        }
    }
    l.print_all();
    return 0;
}

Compiler output:
a.cc:13:5: error: ISO C++ forbids declaration of 'delete_node' with no type [-fpermissive]
   13 |     delete_node(Node* n){
      |     ^~~~~~~~~~~
a.cc: In member function 'int List::delete_node(Node*)':
a.cc:17:5: warning: no return statement in function returning non-void [-Wreturn-type]
   17 |     }
      |     ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>

struct Node{
  int key;
  Node *next,*prev;
};

Node *nil;

Node* listSearch(int key){
  Node *cur =nil->next;
  while(cur!=nil&&cur->key!=key){
    cur=cur->next;
  }
  return cur;
}

void init(){
  nil=(Node *)malloc(sizeof(Node));
  nil->next=nil;
  nil->prev=nil;
}

void printList(){
  Node *cur=nil->next;
  int isf=0;
  while(1){
    if(cur==nil)break;
    if(isf++>0)printf(" ");
    printf("%d",cur->key);
    cur=cur-next;
  }
  printf("\n");
}

void deleteNode(Node *t){
  if(t==nil)return;
  t->prev->next=t->next;
  t->next->prev=t->prev;
  free(t);
}

void deleteFirst(){
  deleteNode(nil->next);
}

void deleteLast(){
  deleteNode(nil->prev);
}

void deletekey(int key){
  deleteNode(listSearch(key));
}

void insert(int key){
  Node *x=(Node *)malloc(sizeof(Node);
  x->key=key;
  x->next=nil->next;
  nil->next->prev=x;
  nil->next=x;
  x->prev=nil;
}

int main(){
  int key,n,i;
  int size=0;
  char com[20];
  int np=0,nd=0;
  scanf("%d",&n);
  init();
  for(i=0;i<n;i++){
    scanf("%s%d",com,&key);
    if(com[0]=='i'){insert(key);np++;size++;}
    else if(com[0]=='d'){
      if(strlen(com)>6){
        if(com[6]=='F')deleteFirst();
        else if(com[6]=='L')deleteLast();
      }else{
        deletekey(key);nd++;
      }
      size--;
    }
  }
  printList();
  return 0;
}

Compiler output:
a.cc: In function 'void printList()':
a.cc:33:13: error: 'next' was not declared in this scope
   33 |     cur=cur-next;
      |             ^~~~
a.cc: In function 'void insert(int)':
a.cc:58:38: error: expected ')' before ';' token
   58 |   Node *x=(Node *)malloc(sizeof(Node);
      |                         ~            ^
      |                                      )
Language: C++

#include<stdio.h>
#include<stdlib.h>
typedef struct node
{
	int value;
    struct node* prev,* next;
}Node;
Node* head;
void Init()
{
    head=(Node*)malloc(sizeof(Node));
    head->next=head;
    head->prev=head;
}

Node* FindNode(int x)
{
	Node*temp=head->next;
	while(temp!=head&&temp->value!=x)
        temp=temp->next;
    return temp;
}
void Insert(int x)
{
	Node*temp=(Node*)malloc(sizeof(Node));
    temp->value=x;
    head->next->prev=temp;
    temp->next=head->next;
    head->next=temp;
    temp->prev=head;
}

void Delete(Node*temp)
{
	if(temp==head)
        return ;
	temp->next->prev=temp->prev;
	temp->prev->next=temp->next;
    free(temp);
}

void DeleteFirst()
{
    Delete(head->next);
}
void DeleteLast()
{
	Delete(head->prev);
}
void DeleteValue(int x)
{
    Delete(FindNode(x))
}
void PrintList()
{
    Node*temp=head->next;
    int flag=0;
    while(1)
    {
        if(temp==head)
            break;
        else
        {
            if(flag++>0)
                printf(" ");
            printf("%d",temp->value);
            temp=temp->next;
        }
    }
    printf("\n");
}
int main()
{
	int n;
	int i;
	scanf("%d",&n);
	char str[12];
	int x;
	Init();
    /*
	while(n--)
	{
		scanf("%s%d",str,&x);
		if(str[0]=='i'){Insert(x);}
		else if(str[0]=='d'&&str[6]=='F')DeleteFirst();
		else if(str[0]=='d'&&str[6]=='L')DeleteLast();
		else if(str[0]=='d'){Delete(FindNode(x));}
	}
    */

	for(i = 0; i < n; i++) {
        scanf("%s %d", str, &x);
        if (str[0] == 'i') {
            Insert(x);
        }
        else if(str[0] == 'd') {
            if(str[6] == 'F')
                DeleteFirst();
            else if(str[6] == 'L')
                DeleteLast();
            else
                DeleteValue(x);
        }
    }
    /*
    Node* temp=head->next;
    while(temp->next!=head)
    {
        printf("%d ",temp->value);
        temp=temp->next;
    }
    printf("%d\n",temp->value);
    */
    PrintList();
	return 0;
}

Compiler output:
a.cc: In function 'void DeleteValue(int)':
a.cc:52:24: error: expected ';' before '}' token
   52 |     Delete(FindNode(x))
      |                        ^
      |                        ;
   53 | }
      | ~
Language: C++

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


int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll N; cin >> N;
  deque<ll> q;
  REP(i, 0, N) {
    string C; ll X; cin >> C;
    if(C[i] == "insert" || C[i] == "delete") cin >> X;

    if(C[i] == "insert") {
      q.push_front(X);
    }
    if(C[i] == "delete") {
      deque<ll> _q;
      bool f = false;
      while(q.size()) {
        if(q.front() != X || f) {
          _q.push_back(q.front());
        } else if(!f) {
          f = true;
        }
        q.pop_front();
      }
      swap(q, _q);
    }
    if(C[i] == "deleteFirst") {
      q.pop_front();
    }
    if(C[i] == "deleteLast") {
      q.pop_back();
    }
  }

  while(q.size()) {
    cout << q.front() << (q.size() != 1 ? " " : "\n");
    q.pop_front();
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if(C[i] == "insert" || C[i] == "delete") cin >> X;
a.cc:15:33: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if(C[i] == "insert" || C[i] == "delete") cin >> X;
a.cc:17:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |     if(C[i] == "insert") {
a.cc:20:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |     if(C[i] == "delete") {
a.cc:33:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   33 |     if(C[i] == "deleteFirst") {
a.cc:36:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   36 |     if(C[i] == "deleteLast") {
Language: C++

#include <iostream>
#include <utility>
#include <string>
#include <vector>

using namespace std;

struct DoubleLinkedList
{
  vector<int> l;
  void insertFront(int x)
  {
      l.insert(l.begin(), x);
  }
  void remove(int x)
  {
    ptrdiff_t pos = distance(l.begin(), find(l.begin(), l.end(), x));
    l.erase(l.begin() + pos);
  }
  void tail()
  {
    l.erase(l.begin());
  }
  void removeLast()
  {
    l.pop_back();
  }
  void print(string delim)
  {
    string s = "";
    for (int i = 0; i < l.size() - 1; i++)
      s += to_string(l[i]) + delim;
    s += to_string(l[l.size() - 1]) + "\n";
    cout << s;
  }
} list;

int main()
{
  int n;
  cin >> n;

  for (int i = 0; i < n; i++)
  {
    string c;
    cin >> c;
    if (c == "insert")
    {
      int v;
      cin >> v;
      list.insertFront(v);
    }
    else if (c == "delete")
    {
      int v;
      cin >> v;
      list.remove(v);
    }
    else if (c == "deleteFirst")
      list.tail();
    else if (c == "deleteLast")
      list.removeLast();
    else
      cout << "input error" << endl;
  }

  list.print(" ");

  return 0;
}

Compiler output:
a.cc: In member function 'void DoubleLinkedList::remove(int)':
a.cc:17:45: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   17 |     ptrdiff_t pos = distance(l.begin(), find(l.begin(), l.end(), x));
      |                                         ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:17:45: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   17 |     ptrdiff_t pos = distance(l.begin(), find(l.begin(), l.end(), x));
      |                                         ~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <utility>
#include <string>
#include <vector>

using namespace std;

struct DoubleLinkedList
{
  vector<int> l;
  void insertFront(int x)
  {
    l.insert(l.begin(), x);
  }
  void remove(int x)
  {
    auto itr = find(l.begin(), l.end(), x);
    size_t pos = distance(l.begin(), itr);
    if (pos == l.size())
      return;
    l.erase(l.begin() + pos);
  }
  void tail()
  {
    l.erase(l.begin());
  }
  void removeLast()
  {
    l.pop_back();
  }
  void print(string delim)
  {
    string s = "";
    for (int i = 0; i < l.size() - 1; i++)
      s += to_string(l[i]) + delim;
    s += to_string(l[l.size() - 1]) + "\n";
    cout << s;
  }
} list;

int main()
{
  int n;
  cin >> n;

  for (int i = 0; i < n; i++)
  {
    string c;
    cin >> c;
    if (c == "insert")
    {
      int v;
      cin >> v;
      list.insertFront(v);
    }
    else if (c == "delete")
    {
      int v;
      cin >> v;
      list.remove(v);
    }
    else if (c == "deleteFirst")
      list.tail();
    else if (c == "deleteLast")
      list.removeLast();
    else
      cout << "input error" << endl;
  }

  list.print(" ");

  return 0;
}

Compiler output:
a.cc: In member function 'void DoubleLinkedList::remove(int)':
a.cc:17:20: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   17 |     auto itr = find(l.begin(), l.end(), x);
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:17:20: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   17 |     auto itr = find(l.begin(), l.end(), x);
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~~~