Language: C++

#include<bits/stdc++.h>
int a[5],n,m,s,c;
int main(){
	cin>>n>>m;
	for(int i=1;i<=n;i++) a[i]=-1;
	for(int i=1;i<=m;i++)
	{
		cin>>s>>c;
		if(a[s]!=-1&&a[s]!=c) {cout<<-1;return 0;}
		else a[s]=c;
	}
	if(n>1&&a[1]==0) cout<<-1;
	else if(n==1)
	{
		if(a[1]==-1) cout<<0;
		else cout<<a[1];
	}
	else
	{
		for(int i=1;i<=n;i++)
		{
			if(i==1&&a[i]==-1) cout<<1;
			else if(a[i]==-1) cout<<0;
			else cout<<a[i];
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |         cin>>n>>m;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:40: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |                 if(a[s]!=-1&&a[s]!=c) {cout<<-1;return 0;}
      |                                        ^~~~
      |                                        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:26: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |         if(n>1&&a[1]==0) cout<<-1;
      |                          ^~~~
      |                          std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:30: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |                 if(a[1]==-1) cout<<0;
      |                              ^~~~
      |                              std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:22: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |                 else cout<<a[1];
      |                      ^~~~
      |                      std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:22:44: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |                         if(i==1&&a[i]==-1) cout<<1;
      |                                            ^~~~
      |                                            std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:23:43: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |                         else if(a[i]==-1) cout<<0;
      |                                           ^~~~
      |                                           std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:24:30: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   24 |                         else cout<<a[i];
      |                              ^~~~
      |                              std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~