Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using P=pair<int,int>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
	int n,m;
	cin>>n>>m;
	vector<P> p(m);//vectorのvector
	
	rep(i,m)cin>>p[i].first>>p[i].second;
	rep(x,1000){
		int keta=1;
		int nx=x/10
		vector<int> d(1,x%10);//?
		
		while(nx){//nxが0にならない限り
			keta++;
			d.push_back(nx%10);
			nx/=10;
		}
		if(keta!=n)continue;
		bool ok=true;
		reverse(d,begin(),d.end());
		rep(i,m){
			if(d[p[i].first-1]!=p[i].second)ok=false;
		}
		if(ok){
			cout<<x<<endl;
			return 0;
		}
	}
	cout<<-1<<endl;
	return 0;
}

//vectorでCE




Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: expected ',' or ';' before 'vector'
   16 |                 vector<int> d(1,x%10);//?
      |                 ^~~~~~
a.cc:20:25: error: 'd' was not declared in this scope
   20 |                         d.push_back(nx%10);
      |                         ^
a.cc:25:25: error: 'd' was not declared in this scope
   25 |                 reverse(d,begin(),d.end());
      |                         ^
a.cc:25:32: error: no matching function for call to 'begin()'
   25 |                 reverse(d,begin(),d.end());
      |                           ~~~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:52:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)'
   52 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:52:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:63:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)'
   63 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:63:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:95:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])'
   95 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:95:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1227:5: note: candidate: 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)'
 1227 |     begin(valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1227:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1238:5: note: candidate: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1238:5: note:   candidate expects 1 argument, 0 provided