题解 [AGC007B] Construct Sequences
构造题。先思考如何让
下面让
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define ll long long
using namespace std;
inline ll read(){
ll x=0,f=1;char ch=getchar();
while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}
while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;
}
const int N=2e4+5;
int a[N],b[N],n,p;
int main(){
n=read();
rep(i,1,n)a[i]=i*N,b[i]=(n-i)*N;
rep(i,1,n)p=read(),b[p]+=i;
rep(i,1,n)printf("%d ",a[i]);
puts("");
rep(i,1,n)printf("%d ",b[i]);
return 0;
}