十年oi一场梦,不开longlong见祖宗。所有东西开longlong 就行了
```
#include <bits/stdc++.h>
using namespace std;
#define int long long
int n,a[1000010];
signed main()
{
cin>>n;
int t=-1;
int m=1e18;
for(int i=1; i<=n; i++)
{
cin>>a[i];
if(a[i]>t) t=a[i];
if(a[i]<m) m=a[i];
}
for(int i=1; i<=n; i++)
{
cout<<t-a[i]<<" ";
}
cout<<endl;
for(int i=1; i<=n; i++)
{
cout<<a[i]-m<<" ";
}
return 0;
}
```
by wangjiayuan @ 2023-09-09 22:36:24