Language: C++

#include <iostream>
#include <vector>
using namespace std;

bool sortWay(pair<int, int> first, pair<int, int> second){
    return first.first < second.first;
}

int main(){
    int n,m;
    cin >> n >> m;
    vector<pair<int, int>> conditions(m);
    for (int i=0;i<m;i++){
        int si, ci;
        cin >> si >> ci;
        conditions[i] = make_pair(si, ci);
    }
    vector<int> memo(m+1);
    for (int i=1;i<=m;i++){
        memo[i] = -1;
    }
    for (auto cond : conditions)#include <iostream>
#include <vector>
using namespace std;

bool sortWay(pair<int, int> first, pair<int, int> second){
    return first.first < second.first;
}

int main(){
    int n,m;
    cin >> n >> m;
    vector<pair<int, int>> conditions(m);
    for (int i=0;i<m;i++){
        int si, ci;
        cin >> si >> ci;
        conditions[i] = make_pair(si, ci);
    }
    vector<int> memo(m+1);
    for (int i=1;i<=m;i++){
        memo[i] = -1;
    }
    for (auto cond : conditions){
        if (cond.first > m  || (memo[cond.first] != -1 && memo[cond.first] != cond.second)){
            cout << "-1" << endl;
            return 0;
        } else {
            memo[cond.first] = cond.second;
        }
    }
    if (n == 1 && memo[1] == 0){
        cout << 0 << endl;
        return 0;
    }
    for (int i=1;i<m+1;i++){
        if (i==1 && memo[i] == 0){
            cout << "-1" << endl;
            return 0;
        }
        if (memo[i] == -1){
            if (i == 1){
                cout << 1;
            } else {
            cout << 0;
            }
        } else {
            cout << memo[i];
        }
    }
    cout << endl;
    return 0;
}
            memo[cond.first] = cond.second;
        }
    }
    if (n == 1 && memo[1] == 0){
        cout << 0 << endl;
        return 0;
    }
    for (int i=1;i<m+1;i++){
        if (i==1 && memo[i] == 0){
            cout << "-1" << endl;
            return 0;
        }
        if (memo[i] == -1){
            if (i == 1){
                cout << 1;
            } else {
            cout << 0;
            }
        } else {
            cout << memo[i];
        }
    }
    cout << endl;
    return 0;
}

Compiler output:
a.cc:22:33: error: stray '#' in program
   22 |     for (auto cond : conditions)#include <iostream>
      |                                 ^
a.cc: In function 'int main()':
a.cc:22:34: error: 'include' was not declared in this scope
   22 |     for (auto cond : conditions)#include <iostream>
      |                                  ^~~~~~~
a.cc:22:51: error: expected primary-expression before '>' token
   22 |     for (auto cond : conditions)#include <iostream>
      |                                                   ^
a.cc:24:1: error: expected primary-expression before 'using'
   24 | using namespace std;
      | ^~~~~
a.cc:26:58: error: a function-definition is not allowed here before '{' token
   26 | bool sortWay(pair<int, int> first, pair<int, int> second){
      |                                                          ^
a.cc:30:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   30 | int main(){
      |         ^~
a.cc:30:9: note: remove parentheses to default-initialize a variable
   30 | int main(){
      |         ^~
      |         --
a.cc:30:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:30:11: error: a function-definition is not allowed here before '{' token
   30 | int main(){
      |           ^
a.cc:73:18: error: 'cond' was not declared in this scope
   73 |             memo[cond.first] = cond.second;
      |                  ^~~~
a.cc: At global scope:
a.cc:75:5: error: expected declaration before '}' token
   75 |     }
      |     ^
a.cc:76:5: error: expected unqualified-id before 'if'
   76 |     if (n == 1 && memo[1] == 0){
      |     ^~
a.cc:80:5: error: expected unqualified-id before 'for'
   80 |     for (int i=1;i<m+1;i++){
      |     ^~~
a.cc:80:18: error: 'i' does not name a type
   80 |     for (int i=1;i<m+1;i++){
      |                  ^
a.cc:80:24: error: 'i' does not name a type
   80 |     for (int i=1;i<m+1;i++){
      |                        ^
a.cc:95:5: error: 'cout' does not name a type
   95 |     cout << endl;
      |     ^~~~
a.cc:96:5: error: expected unqualified-id before 'return'
   96 |     return 0;
      |     ^~~~~~
a.cc:97:1: error: expected declaration before '}' token
   97 | }
      | ^