Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <tuple>
#include <queue>
#include <cmath>
#include <cfloat>
#include <set>
#include <map>

// statics
using namespace std;
using int64 = int_fast64_t;
using PAIR = pair<int64, int64>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 3e5 + 1;

// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T &t) {cin>>t;}
template<typename First, typename...Rest> void MACRO_VAR_Scan(First &first, Rest&...rest) {cin>>first;MACRO_VAR_Scan(rest...);}
#define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;

// out
#define OUT(dist) cout<<(dist);
#define FOUT(n, dist) cout<<fixed<<setprecision(n)<<(dist);
#define SP cout<<" ";
#define BR cout<<endl;
#define zero(n) cout<<setfill('0')<<right<<setw(n)
#define debug(x) cerr<<#x<<":"<< (x);BR;

// utility
#define ALL(a) (a).begin(), (a).end()
#define EACH(i, a) for(auto &&i:(a))
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=0;--i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)

signed main() {
  INIT;
	VAR(int, n);
	VEC(int, p, n);
	vector<int> a(n);
	iota(ALL(a), 1);
	vector<int> b(n);
	b[p.back()-1] = 1e9;
	int last = 1e9+a[p.back()-1];
	RREP(i,n){
		// ai+bi < aj+bj;
		b[p[i]-1] = last - a[p[i]-1]-1;
		last--;
	}
	REP(i, n){
		OUT(a[i]);
		if (i < n-1) SP;
		else BR;
	}
	REP(i, n){
		OUT(b[i]);
		if (i < n-1) SP;
		else BR;
	}
  
  return 0;
}


Compiler output:
a.cc:14:15: error: 'int_fast64_t' does not name a type
   14 | using int64 = int_fast64_t;
      |               ^~~~~~~~~~~~
a.cc:15:19: error: 'int64' was not declared in this scope
   15 | using PAIR = pair<int64, int64>;
      |                   ^~~~~
a.cc:15:26: error: 'int64' was not declared in this scope
   15 | using PAIR = pair<int64, int64>;
      |                          ^~~~~
a.cc:15:31: error: template argument 1 is invalid
   15 | using PAIR = pair<int64, int64>;
      |                               ^
a.cc:15:31: error: template argument 2 is invalid
a.cc:17:11: error: 'int64' does not name a type; did you mean 'int64_t'?
   17 | constexpr int64 LINF = 1LL << 60;
      |           ^~~~~
      |           int64_t
a.cc: In function 'int main()':
a.cc:22:13: error: 'int64' was not declared in this scope
   22 | #define int int64
      |             ^~~~~
a.cc:24:24: note: in definition of macro 'VAR'
   24 | #define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
      |                        ^~~~
a.cc:47:13: note: in expansion of macro 'int'
   47 |         VAR(int, n);
      |             ^~~
a.cc:47:18: error: 'n' was not declared in this scope; did you mean 'yn'?
   47 |         VAR(int, n);
      |                  ^
a.cc:24:56: note: in definition of macro 'VAR'
   24 | #define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
      |                                                        ^~~~~~~~~~~
a.cc:27:36: error: template argument 2 is invalid
   27 | #define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;
      |                                    ^
a.cc:48:9: note: in expansion of macro 'VEC'
   48 |         VEC(int, p, n);
      |         ^~~
a.cc:48:18: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
   48 |         VEC(int, p, n);
      |                  ^
a.cc:27:56: note: in definition of macro 'VEC'
   27 | #define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;
      |                                                        ^
In file included from /usr/include/c++/14/string:53,
                 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:1:
/usr/include/c++/14/bits/range_access.h:114:37: note: 'std::begin' declared here
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
a.cc:48:18: error: 'end' was not declared in this scope; did you mean 'std::end'?
   48 |         VEC(int, p, n);
      |                  ^
a.cc:27:56: note: in definition of macro 'VEC'
   27 | #define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;
      |                                                        ^
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
a.cc:49:19: error: template argument 2 is invalid
   49 |         vector<int> a(n);
      |                   ^
a.cc:38:20: error: request for member 'begin' in 'a', which is of non-class type 'int'
   38 | #define ALL(a) (a).begin(), (a).end()
      |                    ^~~~~
a.cc:50:14: note: in expansion of macro 'ALL'
   50 |         iota(ALL(a), 1);
      |              ^~~
a.cc:38:33: error: request for member 'end' in 'a', which is of non-class type 'int'
   38 | #define ALL(a) (a).begin(), (a).end()
      |                                 ^~~
a.cc:50:14: note: in expansion of macro 'ALL'
   50 |         iota(ALL(a), 1);
      |              ^~~
a.cc:50:9: error: 'iota' was not declared in this scope
   50 |         iota(ALL(a), 1);
      |         ^~~~
a.cc:51:19: error: template argument 2 is invalid
   51 |         vector<int> b(n);
      |                   ^
a.cc:52:13: error: request for member 'back' in 'p', which is of non-class type 'int'
   52 |         b[p.back()-1] = 1e9;
      |             ^~~~
a.cc:53:13: error: expected ';' before 'last'
   53 |         int last = 1e9+a[p.back()-1];
      |             ^~~~
a.cc:54:14: error: expected ';' before 'i'
   54 |         RREP(i,n){
      |              ^
a.cc:43:28: note: in definition of macro 'RREP'
   43 | #define RREP(i, n) for(int i=(n)-1;i>=0;--i)
      |                            ^
a.cc:54:14: error: 'i' was not declared in this scope
   54 |         RREP(i,n){
      |              ^
a.cc:43:36: note: in definition of macro 'RREP'
   43 | #define RREP(i, n) for(int i=(n)-1;i>=0;--i)
      |                                    ^
a.cc:56:29: error: 'last' was not declared in this scope
   56 |                 b[p[i]-1] = last - a[p[i]-1]-1;
      |                             ^~~~
a.cc:59:13: error: expected ';' before 'i'
   59 |         REP(i, n){
      |             ^
a.cc:42:27: note: in definition of macro 'REP'
   42 | #define REP(i, n) for(int i=0;i<(n);++i)
      |                           ^
a.cc:59:13: error: 'i' was not declared in this scope
   59 |         REP(i, n){
      |             ^
a.cc:42:31: note: in definition of macro 'REP'
   42 | #define REP(i, n) for(int i=0;i<(n);++i)
      |                               ^
a.cc:62:17: error: 'else' without a previous 'if'
   62 |                 else BR;
      |                 ^~~~
a.cc:64:13: error: expected ';' before 'i'
   64 |         REP(i, n){
      |             ^
a.cc:42:27: note: in definition of macro 'REP'
   42 | #define REP(i, n) for(int i=0;i<(n);++i)
      |                           ^
a.cc:64:13: error: 'i' was not declared in this scope
   64 |         REP(i, n){
      |             ^
a.cc:42:31: note: in definition of macro 'REP'
   42 | #define REP(i, n) for(int i=0;i<(n);++i)
      |                               ^
a.cc:67:17: error: 'else' without a previous 'if'
   67 |                 else BR;
      |                 ^~~~