func_code_string: #include <bits/stdc++.h>   using namespace std;   long long dx[] = {-1, 0, 1, 0};   long long dy[] = {0, 1, 0, -1};   long long spf[10];   long long dist[1001];   void sieve() {     long long i, j;     for (i = 0; i < 10; i++) spf[i] = i;     for (i = 4; i < 10; i += 2) spf[i] = 2;     for (i = 3; i * i < 10; i++) {       if (spf[i] == i) {         for (j = i * i; j < 10; j += i) {           if (spf[j] == j) spf[j] = i;         }       }     }   }   bool isvowel(char c) {     switch (c) {       case  a :       case  e :       case  i :       case  o :       case  u :       case  y :         return true;       default:         return false;     }   }   bool cmp(pair<long long, long long> x, pair<long long, long long> y) {     return x.first > y.first;   }   long long isPrime(long long n) {     for (long long i = 2; i <= sqrt(n); i++) {       if (n % i == 0) {         return i;       }     }     return n;   }   long long sum(long long n) {     long long ans = 0;     while (n > 0) {       long long d = n % 10;       ans += d;       n /= 10;     }     return ans;   }   vector<long long> adj[5001];   vector<long long> adj1[5001];   long long vis[1001];   long long sub[1001];   long long dist1[1001];   long long vis1[1001];   long long cnt;   void bfs(long long node) {     vis[node] = 1;     queue<long long> q;     q.push(node);     dist[node] = 0;     while (!q.empty()) {       long long curr = q.front();       q.pop();       for (auto child : adj[curr]) {         if (!vis[child]) {           vis[child] = 1;           dist[child] = dist[curr] + 1;           q.push(child);         }       }     }   }   long long dfs(long long node) {     vis[node] = 1;     long long curr_size = 1;     for (auto child : adj[node]) {       if (!vis[child]) {         curr_size += dfs(child);       }     }     sub[node] = curr_size;     return curr_size;   }   struct x {     long long b;     long long c;     long long d;   };   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long t;     t = 1;     while (t--) {       long long n;       cin >> n;       long long a[2 * n + 1];       for (long long i = 1; i <= 2 * n; i++) {         cin >> a[i];       }       long long ans = 0;       for (long long i = 1; i < 2 * n; i += 2) {         long long j;         for (j = i + 1; j <= 2 * n; j++) {           if (a[i] == a[j]) {             break;           }         }         for (; j > i + 1; j--) {           swap(a[j], a[j - 1]);           ans++;         }       }       cout << ans <<   n ;     }     return 0;   }   