Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <sstream>

using namespace std;

static const int none = -1;

struct linkItem
{
	int key = none;
	int nextIdx = -1;
	int prevIdx = -1;
};

struct order
{
	int kind = none;
	int key = none;
};

class dblLinkLst
{
public:
	dblLinkLst() {
	}

	~dblLinkLst() {
	}

	void insertItem(int insKey) {

		int nextLnk = none;
		for (int i = lLen - 1;i >= 0;i--) {
			if (plst[i].key != none) {
				plst[i].prevIdx = plst.size();

				nextLnk = i;
				break;
			}
		}

		linkItem tmp;
		tmp.key = insKey;
		tmp.nextIdx = nextLnk;

		plst.push_back(tmp);

		lLen = plst.size();

	}

	void deleteItem(int delKey) {

		linkItem lnk;
		int thisIdx = 0;
		lnk.key = none;
		for (int i = lLen - 1;i >= 0;i--) {
			if (plst[i].key != none) {
				lnk = plst[i];
				thisIdx = i;
				break;
			}
		}

		if (lnk.key != none) {
			while (true) {
				if (lnk.key == delKey) {
					if (lnk.prevIdx > none)	plst[lnk.prevIdx].nextIdx = lnk.nextIdx;
					if (lnk.nextIdx > none)	plst[lnk.nextIdx].prevIdx = lnk.prevIdx;

					plst[thisIdx].key = none;
					break;
				}

				if (lnk.nextIdx == none) break;

				thisIdx = lnk.nextIdx;
				lnk = plst[thisIdx];
			}
		}
		return;
	}

	void deleteFirst() {
		linkItem lnk;
		int thisIdx = 0;

		for (int i = lLen - 1;i >= 0;i--) {
			if (plst[i].key != none) {
				lnk = plst[i];
				thisIdx = i;
				break;
			}
		}

		if (lnk.key != none) {
			if (lnk.nextIdx > none)	plst[lnk.nextIdx].prevIdx = none;
			plst[thisIdx].key = none;
		}
		return;
	}

	void deleteLast() {
		linkItem lnk;
		int thisIdx = 0;
		for (int i = 0;i < lLen;i++) {
			if (plst[i].key != none) {
				lnk = plst[i];
				thisIdx = i;
				break;
			}
		}

		if (lnk.key != none) {
			if (lnk.prevIdx > none)	plst[lnk.prevIdx].nextIdx = none;
			plst[thisIdx].key = none;
		}

		return;
	}

	string printKeys() {
		string out;
		linkItem lnk;
		lnk.key = none;
		for (int i = lLen - 1;i > 0;i--) {
			if (plst[i].key != none) {
				lnk = plst[i];
				break;
			}
		}

		if (lnk.key != none) {
			while (lnk.nextIdx > none)
			{
				out += to_string(lnk.key) + " ";
				lnk = plst[lnk.nextIdx];
			}
			out += to_string(lnk.key);
		}

		return out;
	}

private:

	vector<	linkItem> plst;
	int lLen = 0;
	int frontIdx = 0;
};


vector<string> split(const string &s, char delim) {
	vector<string> elems;
	stringstream ss(s);
	string item;
	while (getline(ss, item, delim)) {
		if (!item.empty()) {
			elems.push_back(item);
		}
	}
	return elems;
}

int main() {

　　　　int n;
	cin >> n;
	cin.ignore();

	int ttl = 0;
	dblLinkLst dbl;
	vector<order> ords;

	for (int i = 0; i < n; i++) {
		string ln;
		vector<string> arg;
		getline(cin, ln);
		arg = split(ln, ' ');

		string o;
		int key = 0;;

		o = arg[0];
		if (arg.size() == 2) key = stoi(arg[1]);

		order ord;
		ord.key = key;

		if (o == "insert") {
			ord.kind = 0;
		}
		else if (o == "delete") {
			ord.kind = 1;
		}
		else if (o == "deleteFirst") {
			ord.kind = 2;
		}
		else if (o == "deleteLast") {
			ord.kind = 3;
		}

		ords.push_back(ord);
	}


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

		switch (ords[i].kind)
		{

		case 0:
			dbl.insertItem(ords[i].key);
			break;
		case 1:
			dbl.deleteItem(ords[i].key);
			break;
		case 2:
			dbl.deleteFirst();
			break;
		case 3:
			dbl.deleteLast();
			break;

		default:
			break;
		}
			}
	string ans = dbl.printKeys();
	cout << ans << endl;


	return 0;
}



Compiler output:
a.cc:170:1: error: extended character 　 is not valid in an identifier
  170 | 　　　　int n;
      | ^
a.cc:170:1: error: extended character 　 is not valid in an identifier
a.cc:170:1: error: extended character 　 is not valid in an identifier
a.cc:170:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:170:1: error: '\U00003000\U00003000\U00003000\U00003000int' was not declared in this scope
  170 | 　　　　int n;
      | ^~~~~~~~~~~
a.cc:171:16: error: 'n' was not declared in this scope
  171 |         cin >> n;
      |                ^