Language: C++

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

int main(){
  int N,M;
  vector<int> s(M);
  vector<int> c(M);
  vector<int> hoge(N);
  for(int i=0; i<M; i++){
    cin>>s.at(i)>>c.at(i);
  }
  for(int i=0; i<M; i++){
    if(hoge(s.at(i)-1)==0||hoge(s.at(i)-1)==c.at(i)){
      hoge(s.at(i)-1)=c.at(i);
    }
    else{
      cout<<-1<<endl:
      return 0;
    }
  }
  if(N==1){
    cout<<hoge.at(0)<<endl;
  }
  else if(N==2){
    if((hoge.at(0)!=0&&hoge.at(1)==0)||(hoge(0)==0&&hoge(1)==0)){
      cout<<-1<<endl;
    }
    else{
      cout<<hoge.at(0)+hoge.at(1)*10<<endl;
    }
  }
  else{
    if((hoge.at(0)!=-&&hoge.at(1)==0&&hoge.at(2)==0)||(hoge.at(0)==0&&hoge.at(1)==0&&hoge.at(2)==0)||(hoge.at(1)!=0&&hoge.at(2)==0)){
      cout<<-1<<endl;
    }
    else{
      cout<<hoge.at(0)+hoge.at(1)*10+hoge.at(2)*100<<endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: no match for call to '(std::vector<int>) (__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type)'
   13 |     if(hoge(s.at(i)-1)==0||hoge(s.at(i)-1)==c.at(i)){
      |        ~~~~^~~~~~~~~~~
a.cc:13:32: error: no match for call to '(std::vector<int>) (__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type)'
   13 |     if(hoge(s.at(i)-1)==0||hoge(s.at(i)-1)==c.at(i)){
      |                            ~~~~^~~~~~~~~~~
a.cc:14:11: error: no match for call to '(std::vector<int>) (__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type)'
   14 |       hoge(s.at(i)-1)=c.at(i);
      |       ~~~~^~~~~~~~~~~
a.cc:17:21: error: expected ';' before ':' token
   17 |       cout<<-1<<endl:
      |                     ^
      |                     ;
a.cc:25:45: error: no match for call to '(std::vector<int>) (int)'
   25 |     if((hoge.at(0)!=0&&hoge.at(1)==0)||(hoge(0)==0&&hoge(1)==0)){
      |                                         ~~~~^~~
a.cc:25:57: error: no match for call to '(std::vector<int>) (int)'
   25 |     if((hoge.at(0)!=0&&hoge.at(1)==0)||(hoge(0)==0&&hoge(1)==0)){
      |                                                     ~~~~^~~
a.cc:33:22: error: wrong type argument to unary minus
   33 |     if((hoge.at(0)!=-&&hoge.at(1)==0&&hoge.at(2)==0)||(hoge.at(0)==0&&hoge.at(1)==0&&hoge.at(2)==0)||(hoge.at(1)!=0&&hoge.at(2)==0)){
      |                      ^~~~~~
a.cc:33:28: error: expected ')' before '.' token
   33 |     if((hoge.at(0)!=-&&hoge.at(1)==0&&hoge.at(2)==0)||(hoge.at(0)==0&&hoge.at(1)==0&&hoge.at(2)==0)||(hoge.at(1)!=0&&hoge.at(2)==0)){
      |        ~                   ^
      |                            )
a.cc:35:6: error: expected ')' before 'else'
   35 |     }
      |      ^
      |      )
   36 |     else{
      |     ~~~~
a.cc:33:7: note: to match this '('
   33 |     if((hoge.at(0)!=-&&hoge.at(1)==0&&hoge.at(2)==0)||(hoge.at(0)==0&&hoge.at(1)==0&&hoge.at(2)==0)||(hoge.at(1)!=0&&hoge.at(2)==0)){
      |       ^
a.cc:39:3: error: expected primary-expression before '}' token
   39 |   }
      |   ^
a.cc:33:24: error: label 'hoge' used but not defined
   33 |     if((hoge.at(0)!=-&&hoge.at(1)==0&&hoge.at(2)==0)||(hoge.at(0)==0&&hoge.at(1)==0&&hoge.at(2)==0)||(hoge.at(1)!=0&&hoge.at(2)==0)){
      |                        ^~~~