Language: C++

#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>


using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)




int main() {
    ll n;
    cin >> n;
    ll a = 0;
    vector<ll> x(n), y(n);
    cin >> x[0] >> y[0];
    a = (abs(x[0] + y[0])) % 2;
    ll mx = abs(x[0] + y[0]);
    REP(i, n - 1){
        cin >> x[i + 1] >> y[i + 1];
        if(a != abs((x[i + 1] + y[i + 1])) % 2){
            cout << -1 << endl;
            return 0;
        }
        mx = max(mx, abs(x[i + 1] + y[i + 1]));
    }
    ll m = min(40, mx);
    cout << m << endl;
    REP(i, m){
        cout << 1 << ' ';
    }
    cout << endl;
    REP(i, n){
        string w;
        ll c = 0;
        REP(j, abs(x[i])){
            if(x[i] >= 0){
                w += 'R';
            }
            else{
                w += 'L';
            }
            c++;
        }
        REP(j, abs(y[i])){
            if(y[i] >= 0){
                w += 'U';
            }
            else{
                w += 'D';
            }
            c++;
        }
        REP(j, m - c){
            if(j % 2 == 0){
                w += 'R';
            }
            else{
                w += 'L';
            }
        }
        cout << w << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:15: error: no matching function for call to 'min(int, ll&)'
   49 |     ll m = min(40, mx);
      |            ~~~^~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:49:15: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   49 |     ll m = min(40, mx);
      |            ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:9:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:49:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   49 |     ll m = min(40, mx);
      |            ~~~^~~~~~~~