Language: C++

#include<bits/stdc++.h>
usind namespace std;
int main()
{
 long long  int n;
  cin>>n;
  long long int sum=0;
  unordered_map<long long int,long long int>m;
  for(long long int i=0;i<n;i++)
  {
   long long  int temp;
    cin>>temp;
    sum=((long long int)sum+(long long int)temp)%1000000007;
    m[temp]++;
  }
  long long int t;
  cin>>t;
  while(t--)
  {
    long long int a,b;
    cin>>a>>b;
    if(m[a]!=0)
    {
      sum=((long long int)sum-(long long int)(a*m[a])+(long long int)(b*m[a]))%1000000007;
      m[b]=m[b]+m[a];
      m[a]=0;
      cout<<sum<<endl;
    }
    else
    {
      cout<<sum<<endl;
    }
  }
}

Compiler output:
a.cc:2:1: error: 'usind' does not name a type
    2 | usind namespace std;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:3: error: 'unordered_map' was not declared in this scope
    8 |   unordered_map<long long int,long long int>m;
      |   ^~~~~~~~~~~~~
a.cc:8:3: note: suggested alternatives:
In file included from /usr/include/c++/14/unordered_map:41,
                 from /usr/include/c++/14/functional:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/unordered_map.h:109:11: note:   'std::unordered_map'
  109 |     class unordered_map
      |           ^~~~~~~~~~~~~
/usr/include/c++/14/unordered_map:67:13: note:   'std::pmr::unordered_map'
   67 |       using unordered_map
      |             ^~~~~~~~~~~~~
a.cc:8:17: error: expected primary-expression before 'long'
    8 |   unordered_map<long long int,long long int>m;
      |                 ^~~~
a.cc:14:5: error: 'm' was not declared in this scope
   14 |     m[temp]++;
      |     ^
a.cc:22:8: error: 'm' was not declared in this scope
   22 |     if(m[a]!=0)
      |        ^
a.cc:27:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   27 |       cout<<sum<<endl;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:27:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   27 |       cout<<sum<<endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:31:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   31 |       cout<<sum<<endl;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:31:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   31 |       cout<<sum<<endl;
      |                  ^~~~
      |                  std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~