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

#include <iostream>
#include <stdio.h>
using namespace std;

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

Node *nil;

void init() {
    nil = new Node;
    nil->next = nil;
    nil->prev = nil;
}

void insert(int value) {
    Node *node = new Node;
    node->value = value;
    node->next = nil->next;
    nil->next->prev = node;
    nil->next = node;
    node->prev = nil;
}

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

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

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

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

void deleteValue(int value) {
    deleteNode(listSearch(value));
}

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

int main() {

    int n;
    cin >> n;
    init();
    for (int i = 0; i < n; ++i) {
        char command[32];
        cin >> command;
        if (command[0] == 'i') {
            int value;
            cin >> value;
            insert(value);
        } else if (command[0] == 'd') {
            if (strlen(command) > 6) {
                if (command[6] == 'F') deleteFirst();
                else if (command[6] == 'L') deleteLast();
            } else {
                int value;
                cin >> value;
                deleteValue(value);
            }
        }
    }

    print();
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:17: error: 'strlen' was not declared in this scope
   80 |             if (strlen(command) > 6) {
      |                 ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <stdio.h>
Language: C++

#include<iostream>
#include<queue>
#include<string>

using namespace std;

deque<int> dll;

void printList( )
{
	deque<int>::iterator itr = dll.begin( );
	deque<int>::iterator itrE = dll.end( );
	for( ; itr!=itrE; itr++ ) {
		cout<<*itr;
		if( itr != itrE-1 ) cout<<' ';
	}
	cout<<endl;
}
	
int main()
{
	int n;
	ios::sync_with_stdio( false );
	cin>>n;
	
	string cmd;
	int key;
	for( int i=0; i<n; i++ ) {
		cin>>cmd;
		if( "insert" == cmd ) {
			cin>>key;
			dll.push_front( key );
		} else if( "deleteFirst" == cmd ) {
			dll.pop_front( );
		} else if( "deleteLast" == cmd ) {
			dll.pop_back( );
		} else if( "delete" == cmd ) {
			cin>>key;
			deque<int>::iterator itr = dll.begin( );
			itr = find( dll.begin( ), dll.end( ), key );
			if( itr != dll.end( ) ) dll.erase( itr );
		}
	}
	printList( );

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:35: error: no matching function for call to 'find(std::deque<int>::iterator, std::deque<int>::iterator, int&)'
   40 |                         itr = find( dll.begin( ), dll.end( ), key );
      |                               ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:40:35: note:   'std::_Deque_iterator<int, int&, int*>' is not derived from 'std::istreambuf_iterator<_CharT>'
   40 |                         itr = find( dll.begin( ), dll.end( ), key );
      |                               ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <cstdio>
#include <cmath>
#include <iostream>
#include <list>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <numeric>
#include <functional>

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define ALL(a) (a).begin(),(a).end()

using namespace std;
typedef long long ll;

int N;
char q[20];

int main(int argc, char *argv[])
{
  cin.tie(0);
  ios::sync_with_stdio(false);

  scanf("%d", &N);
  list<int> xs;
  REP(i,N){
    scanf("%s", q);
    int len = strlen(q);
    if (len == 11) {
      xs.pop_front();
    } else if (len == 10) {
      xs.pop_back();
    } else {
      int x;
      scanf("%d", &x);
      if (q[0] == 'i') {
        xs.push_front(x);
      } else {
        auto it = find(ALL(xs), x);
        xs.erase(it);
      }
    }
  }

  auto it = xs.begin();
  auto end = xs.end();
  --end;
  while (it != end) {
    cout << *it << ' ';
    ++it;
  }
  cout << *it << endl;
    
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:36:15: error: 'strlen' was not declared in this scope
   36 |     int len = strlen(q);
      |               ^~~~~~
a.cc:14:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   13 | #include <functional>
  +++ |+#include <cstring>
   14 |
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){
  /* your code */
}

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

void printList(){
  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){
  /* your code */
  t->prev->next = t->next;
  t->next->prev = t->prev;

}

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

void deleteLast(){
  /* your code */
  NodePointer d;
  deleteNode(d);
}

void delete(int key){
  /* your code */
  NodePointer d;
  d=listSearch(key);
  deleteNode(d);
}


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

  /* your code */
  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 {
	delete(key); nd++; 
      }
      size--;
    }
  }

  printList();
  return 0;
}

Compiler output:
a.cc: In function 'node* listSearch(int)':
a.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
   17 | }
      | ^
a.cc: In function 'void init()':
a.cc:20:15: error: invalid conversion from 'void*' to 'NodePointer' {aka 'node*'} [-fpermissive]
   20 |   nil = malloc(sizeof(struct node));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |               |
      |               void*
a.cc: At global scope:
a.cc:57:6: error: expected unqualified-id before 'delete'
   57 | void delete(int key){
      |      ^~~~~~
a.cc: In function 'void insert(int)':
a.cc:67:13: error: invalid conversion from 'void*' to 'NodePointer' {aka 'node*'} [-fpermissive]
   67 |   x = malloc(sizeof(struct node));
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc: In function 'int main()':
a.cc:95:16: error: type 'int' argument given to 'delete', expected pointer
   95 |         delete(key); nd++;
      |               ~^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;


class dlink {
public:
	dlink(int k) : prev(NULL), next(NULL), key(k) {}

	dlink *prev;
	dlink *next;
	int key;
};

class list {
public:
	list() : head(NULL), tail(NULL) {}

	dlink *head;
	dlink *tail;

	void ins(int k) {
		dlink *d = new dlink(k);
		if (head) {
			head->prev = d;
			d->next = head;
		} else {
			d->prev = NULL;
			d->next = NULL;
			tail = d;
		}
		head = d;
	}
	void del(int k) {
		dlink *d = head;
		while (d) {
			if (d->key == k) {
				dlink *p = d->prev;
				dlink *n = d->next;
				if (p) p->next = n;
				if (n) n->prev = p;
				if (d == head) head = d->next;
				if (d == tail) tail = d->prev;
				delete d;
				break;
			}
			d = d->next;
		}
	}
	void delFirst() {
		dlink *d = head;
		if (d) {
			head = head->next;
			if (head) {
				head->prev = NULL;
			} else {
				tail = NULL;
			}
			delete d;
		}
	}
	void delLast() {
		dlink *d = tail;
		if (d) {
			tail = tail->prev;
			if (tail) {
				tail->next = NULL;
			} else {
				head = NULL;
			}
			delete d;
		}
	}
};

int main() {
	int n;
	cin >> n;
	list lst;
	char cmd[20];
	int m;
	for (int i = 0; i < n; i++) {
		scanf("%s", cmd);
		if (strcmp(cmd, "insert") == 0) {
			scanf("%d", &m);
			lst.ins(m);
		} else if (strcmp(cmd, "delete") == 0) {
			scanf("%d", &m);
			lst.del(m);
		} else if (strcmp(cmd, "deleteFirst") == 0) {
			lst.delFirst();
		} else if (strcmp(cmd, "deleteLast") == 0) {
			lst.delLast();
		}
	}

	dlink *p = lst.head;
	while (p != NULL) {
		if (p != lst.head) {
			cout << " ";
		}
		cout << p->key;
		p = p->next;
	}
	cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:85:21: error: 'strcmp' was not declared in this scope
   85 |                 if (strcmp(cmd, "insert") == 0) {
      |                     ^~~~~~
a.cc:4:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <cstdlib>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;

/* A node of linked list. */
struct Node
{
    const int key;
    Node *next, *prev;

    public:
        Node(int);
};

Node::Node(int k) : key(k) {};

/* A doubly linked list. */
class DlList
{
    Node *guard;
    void remove(Node*);

    public:
        DlList();
        ~DlList();
        void insert(int);
        void delete_node(int);
        void delete_first();
        void delete_last();
        void print();
};

DlList::DlList()
{
    guard = new Node(-1);
    guard->next = guard->prev = guard;
}

DlList::~DlList()
{
    Node *tmp, *node = guard->next;
    while(node != guard) {
        tmp = node;
        node = node->next;
        delete tmp;
    }
    delete guard;
}

void DlList::insert(int key)
{
    Node *node = new Node(key);
    node->next = guard->next;
    guard->next->prev = node;
    guard->next = node;
    node->prev = guard;
}

void DlList::delete_node(int key)
{
    Node *node = guard->next;
    while( node->key != key && node != guard )
        node = node->next;
    remove(node);
}

void DlList::delete_first()
{
    remove(guard->next);
}

void DlList::delete_last()
{
    remove(guard->prev);
}

void DlList::remove(Node *node)
{
    if (node != guard) {
        node->next->prev = node->prev;
        node->prev->next = node->next;
        delete node;
    }
}

void DlList::print()
{
    Node *node = guard->next;
    if (node == guard)
        return;

    printf("%d", node->key);
    node = node->next;
    while( node != guard ) {
        printf(" %d", node->key);
        node = node->next;
    }
    printf("\n");
}

int main()
{
    DlList list;

    int n_commands;
    cin >> n_commands;

    char command[15];
    int key;
    for (int i = 0; i < n_commands; i++) {
        scanf("%s %d\n", command, &key);
        if (command[0] == 'i') {
            list.insert(key);
        }
        else if (command[0] == 'd') {
            switch( strlen(command) ) {
                case 6:
                    list.delete_node(key); break;
                case 11:
                    list.delete_first(); break;
                case 10:
                    list.delete_last(); break;
            }
        }
    }
    list.print();
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:117:21: error: 'strlen' was not declared in this scope
  117 |             switch( strlen(command) ) {
      |                     ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <cstdlib>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <limits>
#include <string>
#include <vector>
#include <iostream>

using namespace std;

#define INF  INT_MAX

int main()
{
	vector<int> D(2000000, INF);

	vector<int>::size_type first = 0, last = 0;

	int n;

	cin >> n;

	for (vector<int>::size_type i = 0; i < n; i++)
	{
		int A; string S1;

		cin >> S1 >> A;

		if (S1 == "delete")
		{
			for (vector<int>::size_type j = last - 1; j >= first; j--)
			{
				if (D[j] == A)
				{
					D[j] = INF; goto Exit1;
				}
			}

		Exit1:;
		}

		if (S1 == "insert")
		{
			D[last] = A;

			last++;
		}
		
		if (S1 == "deleteFirst")
		{
			D[last - 1] = INF;

			last--;
		}

		if (S1 == "deleteLast")
		{
			D[first] = INF;

			first++;
		}
	}

	int c1 = 0;

	for (int i = n - 1; i >= 0; i--)
	{
		if (D[i] != INF)
		{
			c1++;
		}
	}

	int c2 = 0;

	for (int i = n - 1; i >= 0; i--)
	{
		if (D[i] != INF)
		{
			c2++;

			cout << D[i];

			if (c1 != c2) { cout << ' '; }
		}
	}

	cout << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: 'INT_MAX' was not declared in this scope
    8 | #define INF  INT_MAX
      |              ^~~~~~~
a.cc:12:32: note: in expansion of macro 'INF'
   12 |         vector<int> D(2000000, INF);
      |                                ^~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <iostream>
  +++ |+#include <climits>
    5 |
Language: C++

#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

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

list *head, *tail, *p;

void insert_x(int key) {
	list *make = new list;
	make->key = key;
	if (head == NULL) {
		head = tail = make;
		make->next = make->prev = NULL;
	}
	else {
		head->prev = make;
		make->next = head;
		head = make;
	}
}

void deleteFirst() {
	list* tmp = head;
	if (head == tail) {
		head = tail = NULL;
	}
	else {
		head = head->next;
		head->prev = NULL;
	}
	delete tmp;
}
void deleteLast() {
	list* tmp = tail;
	if (tail == head) {
		head =  tail = NULL;
	}
	else {
		tail = tail->prev;
		tail->next = NULL;
	}
	delete tmp;
}
void delete_x(int key) {
	p = head;
	while (p->key != key) {
		if (p->next == NULL)
			return;
		p = p->next;
	}
	if (p == head)
		deleteFirst();
	else if (p == tail)
		deleteLast();
	else {
		p->prev->next = p->next;
		p->next->prev = p->prev;
		delete p;
	}
}

int main() {
	head = tail = p = NULL;
	int n=0;
	char command[12];
	int key =0;
	scanf_s("%d", &n);
	
	for (int i = 0; i < n; i++) {
		scanf_s("%s", command, 12);
		if (strcmp(command, "insert") == 0) {
			scanf_s("%d", &key);
			insert_x(key);
		}
		else if (strcmp(command, "delete") == 0) {
			scanf_s("%d", &key);
			delete_x(key);
		}
		else if (strcmp(command, "deleteFirst") == 0) {
			deleteFirst();
		}
		else if (strcmp(command, "deleteLast") == 0) {
			deleteLast();
		}
	}

	while(true){
		if (head->next != NULL) {
			cout << head->key << " ";
			head = head->next;
		}
		else {
			cout << head->key << endl;
			break;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   73 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
a.cc:77:21: error: 'strcmp' was not declared in this scope
   77 |                 if (strcmp(command, "insert") == 0) {
      |                     ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | #include <string>
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdio.h>

using namespace std;

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

list *head, *tail, *p;

void insert_x(int key) {
	list *make = new list;
	make->key = key;
	if (head == NULL) {
		head = tail = make;
		make->next = make->prev = NULL;
	}
	else {
		head->prev = make;
		make->next = head;
		head = make;
	}
}

void deleteFirst() {
	list* tmp = head;
	if (head == tail) {
		head = tail = NULL;
	}
	else {
		head = head->next;
		head->prev = NULL;
	}
	delete tmp;
}
void deleteLast() {
	list* tmp = tail;
	if (tail == head) {
		head =  tail = NULL;
	}
	else {
		tail = tail->prev;
		tail->next = NULL;
	}
	delete tmp;
}
void delete_x(int key) {
	p = head;
	while (p->key != key) {
		if (p->next == NULL)
			return;
		p = p->next;
	}
	if (p == head)
		deleteFirst();
	else if (p == tail)
		deleteLast();
	else {
		p->prev->next = p->next;
		p->next->prev = p->prev;
		delete p;
	}
}

int main() {
	head = tail = p = NULL;
	int n=0;
	char command[12];
	int key =0;
	scanf_s("%d", &n);
	
	for (int i = 0; i < n; i++) {
		scanf_s("%s", command, 12);
		if (strcmp(command, "insert") == 0) {
			scanf_s("%d", &key);
			insert_x(key);
		}
		else if (strcmp(command, "delete") == 0) {
			scanf_s("%d", &key);
			delete_x(key);
		}
		else if (strcmp(command, "deleteFirst") == 0) {
			deleteFirst();
		}
		else if (strcmp(command, "deleteLast") == 0) {
			deleteLast();
		}
	}

	while(true){
		if (head->next != NULL) {
			cout << head->key << " ";
			head = head->next;
		}
		else {
			cout << head->key << endl;
			break;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   75 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdio.h>
#include <cstdio>
#include<cstdlib>
#include<cstring>

using namespace std;

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

list *head, *tail, *p;

void insert_x(int key) {
	list *make = new list;
	make->key = key;
	if (head == NULL) {
		head = tail = make;
		make->next = make->prev = NULL;
	}
	else {
		head->prev = make;
		make->next = head;
		head = make;
	}
}

void deleteFirst() {
	list* tmp = head;
	if (head == tail) {
		head = tail = NULL;
	}
	else {
		head = head->next;
		head->prev = NULL;
	}
	delete tmp;
}
void deleteLast() {
	list* tmp = tail;
	if (tail == head) {
		head =  tail = NULL;
	}
	else {
		tail = tail->prev;
		tail->next = NULL;
	}
	delete tmp;
}
void delete_x(int key) {
	p = head;
	while (p->key != key) {
		if (p->next == NULL)
			return;
		p = p->next;
	}
	if (p == head)
		deleteFirst();
	else if (p == tail)
		deleteLast();
	else {
		p->prev->next = p->next;
		p->next->prev = p->prev;
		delete p;
	}
}

int main() {
	head = tail = p = NULL;
	int n=0;
	char command[12];
	int key =0;
	scanf_s("%d", &n);
	
	for (int i = 0; i < n; i++) {
		scanf_s("%s", command, 12);
		if (strcmp(command, "insert") == 0) {
			scanf_s("%d", &key);
			insert_x(key);
		}
		else if (strcmp(command, "delete") == 0) {
			scanf_s("%d", &key);
			delete_x(key);
		}
		else if (strcmp(command, "deleteFirst") == 0) {
			deleteFirst();
		}
		else if (strcmp(command, "deleteLast") == 0) {
			deleteLast();
		}
	}

	while(true){
		if (head->next != NULL) {
			cout << head->key << " ";
			head = head->next;
		}
		else {
			cout << head->key << endl;
			break;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:78:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   78 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <list>
#include <cstdio>

#pragma warning(disable: 4996)

using namespace std;

int main()
{
	int n, v;

	string c;

	list<int> l;

	scanf("%d", &n);

	for (int i = 0; i < n; i++)
	{
		scanf("%s", c.c_str());

		if (c[0] == 'i')
		{
			scanf("%d", &v);

			l.push_front(v);
		}
		else if (c.size() == 11)
		{
			l.pop_front();
		}
		else if (c.size() == 10)
		{
			l.pop_back();
		}
		else
		{
			scanf("%d", &v);

			list<int>::iterator it = l.begin();

			while (it != l.end())
			{
				if (*it == v)
				{
					l.erase(it); break;
				}

				it++;
			}
		}
	}

	list<int>::iterator it = l.begin();

	while (it != l.end())
	{
		if (it == l.begin())
		{
			printf("%d", *it);
		}
		else
		{
			printf(" %d", *it);
		}
	}

	printf("\n");

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'string' was not declared in this scope
   12 |         string c;
      |         ^~~~~~
a.cc:3:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    2 | #include <cstdio>
  +++ |+#include <string>
    3 | 
a.cc:20:29: error: 'c' was not declared in this scope
   20 |                 scanf("%s", c.c_str());
      |                             ^
Language: C++

21
insert 1
insert 2
insert 3
insert 4
insert 5
insert 6
insert 7
insert 8
delete 5
delete 7
insert 9
deleteLast
deleteLast
insert 10
deleteFirst
deleteFirst
delete 8
insert 7
insert 8
delete 4
insert 1

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 21
      | ^~
Language: C++

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

int main() {
    list<int> ls;
    int n; cin >> n;
    while (n--) {
        string c; int t;
        cin >> c;
        if (c == "insert") { int t; cin >> t; ls.push_front(t); }
        else if (c[6] == 'F') ls.pop_front();
        else if (c[6] == 'L') ls.pop_back();
        else {
            int t; cin >> t;
            auto ite = find(ls.begin(), ls.end(), t);
            if (ite != ls.end()) ls.erase(ite);
        }
    }
    int c = 0;
    for (auto ite : ls) {
        if (c) cout << ' ';
        cout << ite; c++;
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: no matching function for call to 'find(std::__cxx11::list<int>::iterator, std::__cxx11::list<int>::iterator, int&)'
   17 |             auto ite = find(ls.begin(), ls.end(), t);
      |                        ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
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:28: note:   'std::_List_iterator<int>' is not derived from 'std::istreambuf_iterator<_CharT>'
   17 |             auto ite = find(ls.begin(), ls.end(), t);
      |                        ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main() {
    list<int> ls;
    int n; cin >> n;
    while (n--) {
        string c; int t;
        cin >> c;
        if (c == "insert") { int t; cin >> t; ls.push_front(t); }
        else if (c[6] == 'F') ls.pop_front();
        else if (c[6] == 'L') ls.pop_back();
        else {
            int t; cin >> t;
            list<int>::iterator ite = find(ls.begin(), ls.end(), t);
            if (ite != ls.end()) ls.erase(ite);
        }
    }
    int c = 0;
    for (list<int>::iterator ite = ls.begin(); ite != ls.end(); ++ite) {
        if (ite != ls.begin()) cout << " ";
        cout << *ite;
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:43: error: no matching function for call to 'find(std::__cxx11::list<int>::iterator, std::__cxx11::list<int>::iterator, int&)'
   17 |             list<int>::iterator ite = find(ls.begin(), ls.end(), t);
      |                                       ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
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:43: note:   'std::_List_iterator<int>' is not derived from 'std::istreambuf_iterator<_CharT>'
   17 |             list<int>::iterator ite = find(ls.begin(), ls.end(), t);
      |                                       ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <stdio.h>

using namespace std;

int main()
{
	const static int INVALID = -1;
	int front = 0, back = 0, size = 0;
	int *allocate_array;

	int n, size = 1000020;
	scanf("%d", &n);
	if (n < 1000020) size = n;

	allocate_array = new int[size];
	char command[12];
	int x;

	for (int i = 0; i < n; i++) {
		scanf("%s", command);
		if (command[0] == 'i') { // insert x
			scanf("%d", &x);
			allocate_array[front] = x;
			front++;
			size++;
		}
		else { // delete???
			switch (command[6]) {
			case '\0': // delete x
				scanf("%d", &x);
				for (int i = front - 1; i >= back; i--) {
					if (allocate_array[i] == x) {
						allocate_array[i] = INVALID;
						if (i == front - 1)
							front--;
						if (i == back)
							back++;
						break;
					}
				}
				break;
			case 'F': // deleteFirst
				if (size > 0) {
					front--;
					size--;
				}
				break;
			case 'L': // deleteLast
				if (size > 0) {
					back++;
					size--;
				}
				break;
			}
		}
	}
	int i = front - 1;
	while (i >= back && allocate_array[i] == INVALID) i--;
	printf("%d", allocate_array[i]);
	i--;
	for (; i >= back; i--) {
		if (allocate_array[i] != INVALID)
			printf(" %d", allocate_array[i]);
	}
	putchar('\n');

	delete[] allocate_array;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: redeclaration of 'int size'
   11 |         int n, size = 1000020;
      |                ^~~~
a.cc:8:34: note: 'int size' previously declared here
    8 |         int front = 0, back = 0, size = 0;
      |                                  ^~~~
Language: C++

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

int main() {
	int i, j, n, x;
	string s;
	list<int> l;
	list<int>::iterator itl;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> s >> x;
		if (s == "insert")l.push_front(x);
		else if (s == "delete") {
			itl = find(l.begin(), l.end(), x);
			l.erase(itl);
		}
		else if (s == "deleteFirst")l.pop_front();
		else if (s == "deleteLast")l.pop_back();
	}
	itl = l.begin();
	while (itl != l.end()) {
		cout << *itl;
		itl++;	
		if (itl != l.end())cout << " ";
	}
	cout << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:35: error: no matching function for call to 'find(std::__cxx11::list<int>::iterator, std::__cxx11::list<int>::iterator, int&)'
   16 |                         itl = 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:16:35: note:   'std::_List_iterator<int>' is not derived from 'std::istreambuf_iterator<_CharT>'
   16 |                         itl = find(l.begin(), l.end(), x);
      |                               ~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>

using namespace std;

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

Node* nil;

void insertValue(int value)
{
	Node* node = (Node*)malloc(sizeof(Node));
	node->value = value;
	node->next = nil->next;
	node->prev = nil;
	node->next->prev = node;
	nil->next = node;
}

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

void deleteValue(int value)
{
	Node* node = nil->next;
	while(node->value != value && node != nil)
	{
		node = node->next;
	}
	deleteNode(node);
}

int main(int argc, char const *argv[])
{
	nil = (Node*)malloc(sizeof(Node));
	nil->next = nil;
	nil->prev = nil;

	int n = 0;
	char cmd[20];
	int value;
	cin >> n;
	for (int i = 0; i < n; ++i)
	{
		scanf("%s %d", cmd, &value);
		if (strcmp(cmd, "insert") == 0)
		{
			insertValue(value);
		} else if(strcmp(cmd, "deleteFirst") == 0) {
			deleteNode(nil->next);
		} else if (strcmp(cmd, "deleteLast") == 0) {
			deleteNode(nil->prev);
		} else {
			deleteValue(value);
		}
	}
	Node* node = nil->next;
	while(node != nil->prev)
	{
		cout << node->value << " ";
		node = node->next;
	}
	cout << node->value << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:55:21: error: 'strcmp' was not declared in this scope
   55 |                 if (strcmp(cmd, "insert") == 0)
      |                     ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

#include <iostream>
#include <string>

using namespace std;

class Node {
public:
	int key;
	Node* next;
	Node* prev;
	Node(int _key, Node* _next, Node* _prev) {
		key = _key;
		next = _next;
		prev = _prev;
	}
};

class List {
	Node* head;
	Node* last;
public:
	List() {
		head = NULL;
		last = NULL;
	}
	void insert(int key) {
		auto node = head;
		head = new Node(key, NULL, node);
		node->prev = head;
	}
	void deleteNode(Node* node) {
		if (node == head)
			head = node->next;
		else
			node->prev->next = node->next;
		if (node == last)
			last = node->prev;
		else
			node->next->prev = node->prev;
		delete node;
	}
	Node* find(int key) {
		Node* current = head;
		while (current) {
			if (current->key == key) {
				deleteNode(current);
				break;
			} else {
				current = current->next;
			}
		}
		return current;
	}
	void deleteFirst() {
		deleteNode(head);
	}
	void deleteLast() {
		deleteNode(last);
	}
};

int main() {
	int n;
	cin >> n;
	
	auto list = List();
	string name;
	int key;
	for (int i=0; i<n; i++) {
		cin >> name;
		if (name == "insert") {
			cin >> key;
			list.insert(key);
		} else if (name == "delete") {
			cin >> key;
			list.deleteNode(list.find(key));
		} else if (name == "deleteFirst") {
			list.deleteFirst();
		} else if (name == "deleteLast") {
			list.deleteLast();
		}
	}
	
	auto current = list.head;
	while (current) {
		cout << current.key << ' ';
		current = current->next;
	}
	cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:84:29: error: 'Node* List::head' is private within this context
   84 |         auto current = list.head;
      |                             ^~~~
a.cc:19:15: note: declared private here
   19 |         Node* head;
      |               ^~~~
a.cc:86:33: error: request for member 'key' in 'current', which is of pointer type 'Node*' (maybe you meant to use '->' ?)
   86 |                 cout << current.key << ' ';
      |                                 ^~~
Language: C++

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

using namespace std;

class Node {
public:
	int key;
	Node* prev;
	Node* next;
	Node(int _key, Node* _prev, Node* _next) {
		key = _key;
		prev = _prev;
		next = _next;
	}
};

class List {
public:
	Node* head;
	Node* last;
	List() {
		head = NULL;
		last = NULL;
	}
	void insert(int key) {
		auto node = head;
		head = new Node(key, NULL, node);
		if (node)
			node->prev = head;
		else
			last = head;
	}
	void deleteNode(Node* node) {
		if (! node)
			return;
		
		if (node == head)
			head = node->next;
		else
			node->prev->next = node->next;
		if (node == last)
			last = node->prev;
		else
			node->next->prev = node->prev;
		delete node;
	}
	Node* find(int key) {
		Node* current = head;
		while (current) {
			if (current->key == key) {
				break;
			} else {
				current = current->next;
			}
		}
		return current;
	}
	void deleteFirst() {
		deleteNode(head);
	}
	void deleteLast() {
		deleteNode(last);
	}
};

int main() {
	int n;
	scanf("%d", &n);
	
	auto list = List();
	string name[100];
	int key;
	for (int i=0; i<n; i++) {
		scanf("%s", name);
		if (name == "insert") {
			scanf("%d", &key);
			list.insert(key);
		} else if (name == "delete") {
			scanf("%d" &key);
			list.deleteNode(list.find(key));
		} else if (name == "deleteFirst") {
			list.deleteFirst();
		} else if (name == "deleteLast") {
			list.deleteLast();
		}
	}
	
	auto current = list.head;
	while (current) {
		if (current != list.head)
			printf(" ");
		printf("%d", current->key);
		current = current->next;
	}
	printf("\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:76:26: error: comparison between distinct pointer types 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} and 'const char*' lacks a cast
   76 |                 if (name == "insert") {
      |                     ~~~~~^~~~~~~~~~~
a.cc:79:33: error: comparison between distinct pointer types 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} and 'const char*' lacks a cast
   79 |                 } else if (name == "delete") {
      |                            ~~~~~^~~~~~~~~~~
a.cc:80:36: error: invalid operands of types 'const char [3]' and 'int' to binary 'operator&'
   80 |                         scanf("%d" &key);
      |                               ~~~~ ^~~~
      |                               |     |
      |                               |     int
      |                               const char [3]
a.cc:82:33: error: comparison between distinct pointer types 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} and 'const char*' lacks a cast
   82 |                 } else if (name == "deleteFirst") {
      |                            ~~~~~^~~~~~~~~~~~~~~~
a.cc:84:33: error: comparison between distinct pointer types 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} and 'const char*' lacks a cast
   84 |                 } else if (name == "deleteLast") {
      |                            ~~~~~^~~~~~~~~~~~~~~
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(" ");
		if (isf++ > 0) cout << " ";
		// printf("%d", cur->key);
		cout << 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);
	cin >> &n;
	init();
	for (i = 0; i < n; i++){
		// scanf("%s%d", com, &key);
		cin >> 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:32:32: error: 'cout' was not declared in this scope
   32 |                 if (isf++ > 0) cout << " ";
      |                                ^~~~
a.cc:34:17: error: 'cout' was not declared in this scope
   34 |                 cout << cur->key;
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:76:9: error: 'cin' was not declared in this scope
   76 |         cin >> &n;
      |         ^~~
Language: C++

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

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(" ");
		if (isf++ > 0) cout << " ";
		// printf("%d", cur->key);
		cout << 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);
	cin >> &n;
	init();
	for (i = 0; i < n; i++){
		// scanf("%s%d", com, &key);
		cin >> 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:32: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   33 |                 if (isf++ > 0) cout << " ";
      |                                ^~~~
      |                                std::cout
In file included from a.cc:4:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:35:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   35 |                 cout << cur->key;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc: In function 'int main()':
a.cc:77:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   77 |         cin >> &n;
      |         ^~~
      |         std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
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 *)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(" ");
		if (isf++ > 0) cout << " ";
		// printf("%d", cur->key);
		cout << 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);
	cin >> n;
	init();
	for (i = 0; i < n; i++){
		// scanf("%s%d", com, &key);
		cin >> 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 insert(int*)':
a.cc:63:13: error: 'key' cannot be used as a member pointer, since it is of type 'int*'
   63 |         x->*key = *key;
      |             ^~~
a.cc: In function 'int main()':
a.cc:82:44: error: invalid type argument of unary '*' (have 'int')
   82 |                 if (com[0] == 'i'){ insert(*key); np++; size++; }
      |                                            ^~~~
a.cc:88:43: error: invalid type argument of unary '*' (have 'int')
   88 |                                 deleteKey(*key); nd++;
      |                                           ^~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
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 *)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(" ");
		if (isf++ > 0) cout << " ";
		// printf("%d", cur->key);
		cout << 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);
	cin >> n;
	init();
	for (i = 0; i < n; i++){
		// scanf("%s%d", com, &key);
		cin >> 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:82:44: error: invalid type argument of unary '*' (have 'int')
   82 |                 if (com[0] == 'i'){ insert(*key); np++; size++; }
      |                                            ^~~~
a.cc:88:43: error: invalid type argument of unary '*' (have 'int')
   88 |                                 deleteKey(*key); nd++;
      |                                           ^~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
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 *)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(" ");
		if (isf++ > 0) cout << " ";
		// printf("%d", cur->key);
		cout << 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);
	cin >> n;
	init();
	for (i = 0; i < n; i++){
		// scanf("%s%d", com, &key);
		cin >> 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 'Node* listSearch(int*)':
a.cc:16:39: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |         while (cur != nil && cur->key != key){
      |                              ~~~~~~~~~^~~~~~
a.cc: In function 'void insert(int*)':
a.cc:63:18: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   63 |         x->key = key;
      |                  ^~~
      |                  |
      |                  int*
a.cc: In function 'int main()':
a.cc:82:44: error: invalid type argument of unary '*' (have 'int')
   82 |                 if (com[0] == 'i'){ insert(*key); np++; size++; }
      |                                            ^~~~
a.cc:88:43: error: invalid type argument of unary '*' (have 'int')
   88 |                                 deleteKey(*key); nd++;
      |                                           ^~~~
Language: C++

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

int main(){
    int q,x;
    string command;

    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 == "deleteFirst"){
            v.pop_front();
        }else if(command == "deleteLast"){
            v.pop_back();
        }else if(command == "delete"){
            cin >> x;
            for (list<int>::iterator it = v.begin(); it = v.bigin() ; it++) {
                if(*it == x){
                    v.erase(it);
                    break;
                }
            }
        }
    }
    int i = 0;
    for(auto itr = v.begin(); itr != v.end(); ++itr) {
        if ( i ++) cout << " ";
        cout << *itr;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:61: error: 'class std::__cxx11::list<int>' has no member named 'bigin'; did you mean 'begin'?
   23 |             for (list<int>::iterator it = v.begin(); it = v.bigin() ; it++) {
      |                                                             ^~~~~
      |                                                             begin