Language: C++

#include<cstdio>
#include<algorithm>
#include <cstdlib>
using namespace std;

int main()
{	
	int N;
	scanf("%d", &N);

	int x[N];
	int y[N];

	for(int i=0;i<N;i++){
		scanf("%d %d", &x[i], &y[i]);
	}
	int answer=0;
	int guki=abs((x[0]+y[0]))%2;
	for(int i=0;i<N;i++){
		if(abs((x[i]+y[i]))%2!=guki)
		{answer=-1;}
		}
	
	if(answer==0)
	{	
		printf("%d\n", 40-guki);
		for(int i=0;i<40-guki;i++)
		{
			printf("1");
		}
		printf("\n");
		for(int i=0;i<N;i++)
		{	int char ans[N];
			if(x[i]>0)
			{	
				for(int j=0;j<x[i];j++)
				{
					ans[j]="R";
				}
			}
			else
			{
				for(int j=0;j<(-x[i]);j++)
				{
					ans[j]="L";
				}
			}
			if(y[i]>0)
			{	
				for(int j=0;j<y[i];j++)
				{
					ans[j]="U";
				}
			}
			else
			{
				for(int j=0;j<(-y[i]);j++)
				{
					ans[j]="D";
				}
			}
			for(int j=abs(x[i])+abs(y[i]);j<40-guki;j++)
				{
					if(j%2==0){
					ans[j]="D";;}
					else{ans[j]="U";}
				}
			printf("%s\n",ans);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
		}
		
	}
	else
	{printf("%d", answer);}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:25: error: two or more data types in declaration of 'ans'
   33 |                 {       int char ans[N];
      |                         ^~~
a.cc:38:41: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |                                         ans[j]="R";
      |                                         ^~~
      |                                         abs
a.cc:45:41: error: 'ans' was not declared in this scope; did you mean 'abs'?
   45 |                                         ans[j]="L";
      |                                         ^~~
      |                                         abs
a.cc:52:41: error: 'ans' was not declared in this scope; did you mean 'abs'?
   52 |                                         ans[j]="U";
      |                                         ^~~
      |                                         abs
a.cc:59:41: error: 'ans' was not declared in this scope; did you mean 'abs'?
   59 |                                         ans[j]="D";
      |                                         ^~~
      |                                         abs
a.cc:65:41: error: 'ans' was not declared in this scope; did you mean 'abs'?
   65 |                                         ans[j]="D";;}
      |                                         ^~~
      |                                         abs
a.cc:66:46: error: 'ans' was not declared in this scope; did you mean 'abs'?
   66 |                                         else{ans[j]="U";}
      |                                              ^~~
      |                                              abs
a.cc:68:39: error: 'ans' was not declared in this scope; did you mean 'abs'?
   68 |                         printf("%s\n",ans);
      |                                       ^~~
      |                                       abs