Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n, m;
  cin >> n >> m;
  
  vector<vector<int>> sc(m,vector<int>(2));
  for(int i=0; i<m; i++){
  cin >> sc[i][0] >> sc[i][1];
  }
  
  queue<string> q;
  
  while(q.size()==0){
  for(int j=0; j<1000; j++){
  int ans=0;
    ans = ans + j;
    if(ans < 10){
    string add = '00';
    string s = add + to_string(ans);
    }
    else if(10 <= ans && ans < 100){
     string add = '0';
    string s = add + to_string(ans);
    } 
    else if(100 <= ans && ans < 1000){
    string s = add + to_string(ans);
    }  
      
    if(s.size()==n+1){
      int match=0;
      for(int k=0; k<m; k++){
       if(s[sc[k][0]]==sc[k][1]){
         match++;
       }
      }
        if(match==m){
      q.push(ans);
      }
    }
    
    if(q.size()!=0){
      cout << ans << endl;
    }
    else if(q.size()==0){
      cout << -1 << endl;
    }
}

Compiler output:
a.cc:20:18: warning: multi-character character constant [-Wmultichar]
   20 |     string add = '00';
      |                  ^~~~
a.cc: In function 'int main()':
a.cc:20:18: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
a.cc:24:19: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   24 |      string add = '0';
      |                   ^~~
a.cc:28:16: error: 'add' was not declared in this scope; did you mean 'std::filesystem::perm_options::add'?
   28 |     string s = add + to_string(ans);
      |                ^~~
      |                std::filesystem::perm_options::add
In file included from /usr/include/c++/14/filesystem:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_fwd.h:219:7: note: 'std::filesystem::perm_options::add' declared here
  219 |       add       = 0x2,
      |       ^~~
a.cc:31:8: error: 's' was not declared in this scope
   31 |     if(s.size()==n+1){
      |        ^
a.cc:39:13: error: no matching function for call to 'std::queue<std::__cxx11::basic_string<char> >::push(int&)'
   39 |       q.push(ans);
      |       ~~~~~~^~~~~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157:
/usr/include/c++/14/bits/stl_queue.h:283:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Sequence = std::deque<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > >; value_type = std::__cxx11::basic_string<char>]'
  283 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:283:30: note:   no known conversion for argument 1 from 'int' to 'const std::queue<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  283 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:288:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Sequence = std::deque<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > >; value_type = std::__cxx11::basic_string<char>]'
  288 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:288:25: note:   no known conversion for argument 1 from 'int' to 'std::queue<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
  288 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
a.cc:49:2: error: expected '}' at end of input
   49 | }
      |  ^
a.cc:15:21: note: to match this '{'
   15 |   while(q.size()==0){
      |                     ^
a.cc:49:2: error: expected '}' at end of input
   49 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^