Language: C++

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#include <set>
#include <map>
#define rep(i,n) for (int i=0; i<n;++i)
#define ALL(a)  (a).begin(),(a).end()
#define PI 3.14159265358979
typedef long long ll;
using namespace std;
typedef pair<int, int> P;
const ll MOD = 1e9+7LL;
const int INF = 2e9;
int N, M;
int s[10], c[10];
vector<P> a;

int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);

  cin >> N >> M;
  rep(i, M) {
    cin >> s[i] >> c[i];
    a.push_back(P(s[i], c[i]));
  }
  sort(ALL(a));
  int now=0;
  int idx=0;
  int th = 0;
  int ans = 0;
  rep(i, M) {
    if (a[i].first && a[i].second==0) {
      cout << -1 << "\n";
      return 0;
    }
    if (a[i].first!=now) {
      now = a[i].first;
      th = a[i].second;
      ans+=a[i].second*pow(10, N-a[i].first);
      continue;
    }
    if (th!=a[i].second) {
      cout << -1 << "\n";
      return 0;
    }
  }
  
  if (a[0].first!=1) {
    ans+=1*pow(10, N-1);
  }

  cout << ans << "\n";
  return 0;
}#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#include <set>
#include <map>
#define rep(i,n) for (int i=0; i<n;++i)
#define ALL(a)  (a).begin(),(a).end()
#define PI 3.14159265358979
typedef long long ll;
using namespace std;
typedef pair<int, int> P;
const ll MOD = 1e9+7LL;
const int INF = 2e9;
int N, M;
int s[10], c[10];
vector<P> a;

int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);

  cin >> N >> M;
  rep(i, M) {
    cin >> s[i] >> c[i];
    a.push_back(P(s[i], c[i]));
  }
  sort(ALL(a));
  int now=0;
  int idx=0;
  int th = 0;
  int ans = 0;
  rep(i, M) {
    if (a[i].first && a[i].second==0) {
      cout << -1 << "\n";
      return 0;
    }
    if (a[i].first!=now) {
      now = a[i].first;
      th = a[i].second;
      ans+=a[i].second*pow(10, N-a[i].first);
      continue;
    }
    if (th!=a[i].second) {
      cout << -1 << "\n";
      return 0;
    }
  }
  
  if (a[0].first!=1) {
    ans+=1*pow(10, N-1);
  }

  cout << ans << "\n";
  return 0;
}

Compiler output:
a.cc:65:2: error: stray '#' in program
   65 | }#include <algorithm>
      |  ^
a.cc:65:3: error: 'include' does not name a type
   65 | }#include <algorithm>
      |   ^~~~~~~
a.cc:85:10: error: redefinition of 'const ll MOD'
   85 | const ll MOD = 1e9+7LL;
      |          ^~~
a.cc:21:10: note: 'const ll MOD' previously defined here
   21 | const ll MOD = 1e9+7LL;
      |          ^~~
a.cc:86:11: error: redefinition of 'const int INF'
   86 | const int INF = 2e9;
      |           ^~~
a.cc:22:11: note: 'const int INF' previously defined here
   22 | const int INF = 2e9;
      |           ^~~
a.cc:87:5: error: redefinition of 'int N'
   87 | int N, M;
      |     ^
a.cc:23:5: note: 'int N' previously declared here
   23 | int N, M;
      |     ^
a.cc:87:8: error: redefinition of 'int M'
   87 | int N, M;
      |        ^
a.cc:23:8: note: 'int M' previously declared here
   23 | int N, M;
      |        ^
a.cc:88:5: error: redefinition of 'int s [10]'
   88 | int s[10], c[10];
      |     ^
a.cc:24:5: note: 'int s [10]' previously declared here
   24 | int s[10], c[10];
      |     ^
a.cc:88:12: error: redefinition of 'int c [10]'
   88 | int s[10], c[10];
      |            ^
a.cc:24:12: note: 'int c [10]' previously declared here
   24 | int s[10], c[10];
      |            ^
a.cc:89:11: error: redefinition of 'std::vector<std::pair<int, int> > a'
   89 | vector<P> a;
      |           ^
a.cc:25:11: note: 'std::vector<std::pair<int, int> > a' previously declared here
   25 | vector<P> a;
      |           ^
a.cc:91:5: error: redefinition of 'int main()'
   91 | int main() {
      |     ^~~~
a.cc:27:5: note: 'int main()' previously defined here
   27 | int main() {
      |     ^~~~