Language: C++

#include<iostream>
#include<string>
#include<string.h>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
using namespace std;
const long long maxd=1<<31;
int x[1010],y[1010],pow[1010],sum[1010],n;
int main()
{
    scanf("%d",&n);int i,j;
    for (i=1;i<=n;i++) 
    {
        scanf("%d%d",&x[i],&y[i]);
        sum[i]=abs(x[i]+y[i]);
    }
    for (i=1;i<n;i++)
        if (sum[i]%2!=sum[i+1]%2) {printf("%d",-1);return 0;}
    int maxd=0,cnt=0;
    for (i=1;i<=n;i++) maxd=max(maxd,sum[i]);
    if  (!(sum[1]%2)) {pow[++cnt]=1;maxd--;}int tmp=1;
    while (tmp<=maxd+1) {pow[++cnt]=tmp;tmp*=2;}
    printf("%d\n",cnt);
    for (i=1;i<=cnt;i++) printf("%d ",pow[cnt-i+1]);printf("\n");
    for (i=1;i<=n;i++)
    {
        int fx=x[i],fy=y[i],nx=0,ny=0;
        for (j=cnt;j>=1;j--)
        {
            int chax=fx-nx,chay=fy-ny;
            if (abs(chax)>abs(chay))
            {
                if (chax>0) {printf("R");nx+=pow[j];}
                else {printf("L");nx-=pow[j];}
            }
            else 
            {
                if (chay>0) {printf("U");ny+=pow[j];}
                else {printf("D");ny-=pow[j];}
            }
        }
        printf("\n");
    }
    return 0;
}

Compiler output:
a.cc:12:29: error: 'int pow [1010]' redeclared as different kind of entity
   12 | int x[1010],y[1010],pow[1010],sum[1010],n;
      |                             ^
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/bits/requires_hosted.h:31,
                 from /usr/include/c++/14/iostream:38,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: previous declaration 'double pow(double, double)'
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:25:27: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   25 |     if  (!(sum[1]%2)) {pow[++cnt]=1;maxd--;}int tmp=1;
      |                           ^
a.cc:26:29: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   26 |     while (tmp<=maxd+1) {pow[++cnt]=tmp;tmp*=2;}
      |                             ^
a.cc:28:42: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   28 |     for (i=1;i<=cnt;i++) printf("%d ",pow[cnt-i+1]);printf("\n");
      |                                          ^
a.cc:37:49: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   37 |                 if (chax>0) {printf("R");nx+=pow[j];}
      |                                                 ^
a.cc:38:42: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   38 |                 else {printf("L");nx-=pow[j];}
      |                                          ^
a.cc:42:49: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   42 |                 if (chay>0) {printf("U");ny+=pow[j];}
      |                                                 ^
a.cc:43:42: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   43 |                 else {printf("D");ny-=pow[j];}
      |                                          ^