Language: C++

/*
 　　　　　／＞　 フ
 　　　　　| 　_　 _|
 　 　　　／`ミ _x 彡
 　　 　 /　　　 　 |
 　　　 /　  ヽ　　 ?
 　／￣|　　 |　|　|
 　| (￣ヽ＿_ヽ_)_)
 　＼二つ
  */

#include <queue>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define MP make_pair
#define ll long long
#define fi first
#define se second
using namespace std;

template <typename T>
void read(T &x) {
    x = 0; bool f = 0;
    char c = getchar();
    for (;!isdigit(c);c=getchar()) if (c=='-') f=1;
    for (;isdigit(c);c=getchar()) x=x*10+(c^48);
    if (f) x=-x;
}

template<typename F>
inline void write(F x, char ed = '\n') {
    static short st[30];short tp=0;
    if(x<0) putchar('-'),x=-x;
    do st[++tp]=x%10,x/=10; while(x);
    while(tp) putchar('0'|st[tp--]);
    putchar(ed);
}

template <typename T>
inline void Mx(T &x, T y) { x < y && (x = y); }

template <typename T>
inline void Mn(T &x, T y) { x > y && (x = y); }

const int N = 2005;
ll len[N], x[N], y[N], cnt, n;
inline ll jue(ll x) { return x > 0 ? x : -x; }
int main() {
    read(n);
    for (int i = 1;i <= n; i++) {
        read(x[i]), read(y[i]);
        int t = (x[i] + y[i]) & 1;
        t ^= (x[1] + y[1]) & 1;
        if (t) { puts("-1"); return 0; }
    }
    if (!((x[1] + y[1]) & 1)) len[++cnt] = 1;
    write(cnt + 33);
    for (int i = 0;i <= 32; i++) len[++cnt] = 1ll << i;
    for (int i = cnt;i ; i--) write(len[i], ' ');
    puts("");
    for (int i = 1;i <= n; i++) {
        ll dx = 0, dy = 0;
        for (int j = cnt;j >= 1; j--) {
            ll tx = jue(x[i] - dx), ty = jue(y[i] - dy);
            if (tx >= ty) {
                if (x[i] > dx) { putchar('R'); dx += len[j]; }
                else { putchar('L'); dx -= len[j]; }
            }
            else {
                if (y[i] > dy) { putchar('U'); dy += len[j]; }
                else { putchar('D'); dy -= len[j]; }
            }
        }
        puts("");
    }
    return 0;
}

请按 ENTER 或其它命令继续
/*
 　　　　　／＞　 フ
 　　　　　| 　_　 _|
 　 　　　／`ミ _x 彡
 　　 　 /　　　 　 |
 　　　 /　  ヽ　　 ?
 　／￣|　　 |　|　|
 　| (￣ヽ＿_ヽ_)_)
 　＼二つ
  */

#include <queue>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define MP make_pair
#define ll long long
#define fi first
#define se second
using namespace std;

template <typename T>
void read(T &x) {
    x = 0; bool f = 0;
    char c = getchar();
    for (;!isdigit(c);c=getchar()) if (c=='-') f=1;
    for (;isdigit(c);c=getchar()) x=x*10+(c^48);
    if (f) x=-x;
}

template<typename F>
inline void write(F x, char ed = '\n') {
    static short st[30];short tp=0;
    if(x<0) putchar('-'),x=-x;
    do st[++tp]=x%10,x/=10; while(x);
    while(tp) putchar('0'|st[tp--]);
    putchar(ed);
}

template <typename T>
inline void Mx(T &x, T y) { x < y && (x = y); }

template <typename T>
inline void Mn(T &x, T y) { x > y && (x = y); }

const int N = 2005;
ll len[N], x[N], y[N], cnt, n;
inline ll jue(ll x) { return x > 0 ? x : -x; }
int main() {
    read(n);
    for (int i = 1;i <= n; i++) {
        read(x[i]), read(y[i]);
        int t = (x[i] + y[i]) & 1;
        t ^= (x[1] + y[1]) & 1;
        if (t) { puts("-1"); return 0; }
    }
    if (!((x[1] + y[1]) & 1)) len[++cnt] = 1;
    write(cnt + 33);
    for (int i = 0;i <= 32; i++) len[++cnt] = 1ll << i;
    for (int i = cnt;i ; i--) write(len[i], ' ');
    puts("");
    for (int i = 1;i <= n; i++) {
        ll dx = 0, dy = 0;
        for (int j = cnt;j >= 1; j--) {
            ll tx = jue(x[i] - dx), ty = jue(y[i] - dy);
            if (tx >= ty) {
                if (x[i] > dx) { putchar('R'); dx += len[j]; }
                else { putchar('L'); dx -= len[j]; }
            }
            else {
                if (y[i] > dy) { putchar('U'); dy += len[j]; }
                else { putchar('D'); dy -= len[j]; }
            }
        }
        puts("");
    }
    return 0;
}


Compiler output:
a.cc:82:1: error: '\U00008bf7\U00006309' does not name a type
   82 | 请按 ENTER 或其它命令继续
      | ^~~~
a.cc:107:6: error: redefinition of 'template<class T> void read(T&)'
  107 | void read(T &x) {
      |      ^~~~
a.cc:25:6: note: 'template<class T> void read(T&)' previously declared here
   25 | void read(T &x) {
      |      ^~~~
a.cc:116:13: error: redefinition of 'template<class F> void write(F, char)'
  116 | inline void write(F x, char ed = '\n') {
      |             ^~~~~
a.cc:34:13: note: 'template<class F> void write(F, char)' previously declared here
   34 | inline void write(F x, char ed = '\n') {
      |             ^~~~~
a.cc:125:13: error: redefinition of 'template<class T> void Mx(T&, T)'
  125 | inline void Mx(T &x, T y) { x < y && (x = y); }
      |             ^~
a.cc:43:13: note: 'template<class T> void Mx(T&, T)' previously declared here
   43 | inline void Mx(T &x, T y) { x < y && (x = y); }
      |             ^~
a.cc:128:13: error: redefinition of 'template<class T> void Mn(T&, T)'
  128 | inline void Mn(T &x, T y) { x > y && (x = y); }
      |             ^~
a.cc:46:13: note: 'template<class T> void Mn(T&, T)' previously declared here
   46 | inline void Mn(T &x, T y) { x > y && (x = y); }
      |             ^~
a.cc:130:11: error: redefinition of 'const int N'
  130 | const int N = 2005;
      |           ^
a.cc:48:11: note: 'const int N' previously defined here
   48 | const int N = 2005;
      |           ^
a.cc:131:4: error: redefinition of 'long long int len [2005]'
  131 | ll len[N], x[N], y[N], cnt, n;
      |    ^~~
a.cc:49:4: note: 'long long int len [2005]' previously declared here
   49 | ll len[N], x[N], y[N], cnt, n;
      |    ^~~
a.cc:131:12: error: redefinition of 'long long int x [2005]'
  131 | ll len[N], x[N], y[N], cnt, n;
      |            ^
a.cc:49:12: note: 'long long int x [2005]' previously declared here
   49 | ll len[N], x[N], y[N], cnt, n;
      |            ^
a.cc:131:18: error: redefinition of 'long long int y [2005]'
  131 | ll len[N], x[N], y[N], cnt, n;
      |                  ^
a.cc:49:18: note: 'long long int y [2005]' previously declared here
   49 | ll len[N], x[N], y[N], cnt, n;
      |                  ^
a.cc:131:24: error: redefinition of 'long long int cnt'
  131 | ll len[N], x[N], y[N], cnt, n;
      |                        ^~~
a.cc:49:24: note: 'long long int cnt' previously declared here
   49 | ll len[N], x[N], y[N], cnt, n;
      |                        ^~~
a.cc:131:29: error: redefinition of 'long long int n'
  131 | ll len[N], x[N], y[N], cnt, n;
      |                             ^
a.cc:49:29: note: 'long long int n' previously declared here
   49 | ll len[N], x[N], y[N], cnt, n;
      |                             ^
a.cc:132:11: error: redefinition of 'long long int jue(long long int)'
  132 | inline ll jue(ll x) { return x > 0 ? x : -x; }
      |           ^~~
a.cc:50:11: note: 'long long int jue(long long int)' previously defined here
   50 | inline ll jue(ll x) { return x > 0 ? x : -x; }
      |           ^~~
a.cc:133:5: error: redefinition of 'int main()'
  133 | int main() {
      |     ^~~~
a.cc:51:5: note: 'int main()' previously defined here
   51 | int main() {
      |     ^~~~