Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
  int N,M;cin>>N>>M;
  if(M==0) cout<<pow(10,N-1)<<endl;
  else{
    string ans;
    vector<pair<int,int>> A;
    for(int i=0;i<M;i++){
      int s,c;cin>>s>>c;
      A.push_back((s,c));
    }
    sort(A.begin(),A.end());
    bool can=true;
    queue<int> B;
    for(int i=0;i<M-1;i++){
      if(A.at(i).first==A.at(i+1).first && A.at(i).second!=A.at(i+1).second) can=false;
      else if(A.at(i).first==A.at(i+1).first
    }
    if(!can) cout<<-1<<endl;
    else{
      ans.push_back(to_string(A.at(0).second));
      
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(int&)'
   12 |       A.push_back((s,c));
      |       ~~~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'int' to 'const std::vector<std::pair<int, int> >::value_type&' {aka 'const std::pair<int, int>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::pair<int, int> >::value_type&&' {aka 'std::pair<int, int>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:19:45: error: expected ')' before '}' token
   19 |       else if(A.at(i).first==A.at(i+1).first
      |              ~                              ^
      |                                             )
   20 |     }
      |     ~                                        
a.cc:20:5: error: expected primary-expression before '}' token
   20 |     }
      |     ^
a.cc:23:30: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char'
   23 |       ans.push_back(to_string(A.at(0).second));
      |                     ~~~~~~~~~^~~~~~~~~~~~~~~~
      |                              |
      |                              std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/string:54,
                 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/basic_string.h:1572:24: note:   initializing argument 1 of 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1572 |       push_back(_CharT __c)
      |                 ~~~~~~~^~~
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:7:7: note: to match this '{'
    7 |   else{
      |       ^
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^