Language: C++

using namespace std;
#define _GLIBCXX_DEBUG
// 省略
#define ll long long
#define ld long double
#define Vi vector<int>
#define Vl vector<ll>
// for
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define Repp(i, a, b) for (int i = a; i <= (int)(b); i++)
#define Repm(i, a, b) for (int i = a; i <= (int)(b); i—-)
// 入力
#define ini(x) int x; cin >> x;
#define inl(x) ll x; cin >> x;
#define ind(x) double x; cin >> x;
#define inc(x) char x; cin >> x;
#define ins(x) string x; cin >> x;
// 出力
#define co(x) cout << x;
#define ce cout << endl;
#define cs cout << “ “;
#define keta(x) cout << fixed << setprecision(x);
// 配列
#define Sort(x) sort(x.begin(), x.end()); // 小順
#define Rev(x) reverse(x.begin(), x.end());

int main() {
  ini(N)
  Vi As(200000, 0);
  rep(i, N){
    ini(A) As[A]++; 
  }
  
  ll ans = 0;
  rep(i, 200000){
    ans += i*As[i];
  }
    
  ini(Q) 
  rep(i, Q){
    ini(B) ini(C)
    int keep;
    keep = As[B]; As[B] = 0;
    ans -= keep*B;
    As[C] += keep;
    ans += keep*C;
    co(ans) ce
  }
}

Compiler output:
a.cc:12:54: error: extended character — is not valid in an identifier
   12 | #define Repm(i, a, b) for (int i = a; i <= (int)(b); i—-)
      |                                                      ^
a.cc:22:20: error: extended character “ is not valid in an identifier
   22 | #define cs cout << “ “;
      |                    ^
a.cc:22:22: error: extended character “ is not valid in an identifier
   22 | #define cs cout << “ “;
      |                      ^
a.cc: In function 'int main()':
a.cc:14:23: error: 'cin' was not declared in this scope
   14 | #define ini(x) int x; cin >> x;
      |                       ^~~
a.cc:29:3: note: in expansion of macro 'ini'
   29 |   ini(N)
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:6:12: error: 'vector' was not declared in this scope
    6 | #define Vi vector<int>
      |            ^~~~~~
a.cc:30:3: note: in expansion of macro 'Vi'
   30 |   Vi As(200000, 0);
      |   ^~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:6:19: error: expected primary-expression before 'int'
    6 | #define Vi vector<int>
      |                   ^~~
a.cc:30:3: note: in expansion of macro 'Vi'
   30 |   Vi As(200000, 0);
      |   ^~
a.cc:32:12: error: 'As' was not declared in this scope; did you mean 'A'?
   32 |     ini(A) As[A]++;
      |            ^~
      |            A
a.cc:37:14: error: 'As' was not declared in this scope; did you mean 'cs'?
   37 |     ans += i*As[i];
      |              ^~
      |              cs
a.cc:44:12: error: 'As' was not declared in this scope; did you mean 'cs'?
   44 |     keep = As[B]; As[B] = 0;
      |            ^~
      |            cs
a.cc:20:15: error: 'cout' was not declared in this scope
   20 | #define co(x) cout << x;
      |               ^~~~
a.cc:48:5: note: in expansion of macro 'co'
   48 |     co(ans) ce
      |     ^~
a.cc:20:15: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   20 | #define co(x) cout << x;
      |               ^~~~
a.cc:48:5: note: in expansion of macro 'co'
   48 |     co(ans) ce
      |     ^~
a.cc:21:20: error: 'endl' was not declared in this scope
   21 | #define ce cout << endl;
      |                    ^~~~
a.cc:48:13: note: in expansion of macro 'ce'
   48 |     co(ans) ce
      |             ^~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;