Submission #1766707


Source Code Expand

#include<iostream>
#include<cstdio>
#include<vector>
#include<map>
#include<string>
#include<sstream>
#include<cmath>
#include<climits>
#include<algorithm>
#include<bitset>
#include<set>
#include<stack>
#include<queue>
#include<iomanip>
#include<memory.h>
#include<complex>
using namespace std;  
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef tuple<int,int> tii;
#define rep(i,n) for(ll i=0;i<(n);i++)  
#define pb push_back
#define mt make_tuple
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second  
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-8;
const double PI = M_PI;  
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define SHOWARRAY(ar,i,j) REP(a,i)REP(b,j)cerr<<ar[a][b]<<((b==j-1)?((a==i-1)?("\n\n"):("\n")):(" "))
#define DIV int(1e9+7)
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;}
inline ll lcm(ll d1, ll d2){return d1 / __gcd(d1, d2) * d2;}

 /* Coding Space*/
int main(){
  const ll base = 40010;
  int n; cin >> n;
  vector<ll> ans_a;
  vector<ll> ans_b;
  rep(i,n){
    ans_a.pb(base*i+base);
    ans_b.pb(base*(n-i-1)+base);
  }

  rep(i,n){
    int in; cin >> in; in--;
    ans_a[in] -= (n-i);
  }
  rep(i,n) cout << ans_a[i] << ((i==n-1)?"\n":" ");
  rep(i,n) cout << ans_b[i] << ((i==n-1)?"\n":" ");
}

Submission Info

Submission Time
Task B - Construct Sequences
User cashisu1
Language C++14 (GCC 5.4.1)
Score 400
Code Size 1443 Byte
Status AC
Exec Time 11 ms
Memory 1148 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 22
Set Name Test Cases
Sample example0.txt, example1.txt, example2.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, example0.txt, example1.txt, example2.txt
Case Name Status Exec Time Memory
000.txt AC 2 ms 384 KB
001.txt AC 2 ms 256 KB
002.txt AC 2 ms 256 KB
003.txt AC 1 ms 256 KB
004.txt AC 2 ms 384 KB
005.txt AC 10 ms 1148 KB
006.txt AC 3 ms 384 KB
007.txt AC 9 ms 1020 KB
008.txt AC 6 ms 768 KB
009.txt AC 10 ms 1148 KB
010.txt AC 10 ms 1148 KB
011.txt AC 11 ms 1148 KB
012.txt AC 11 ms 1148 KB
013.txt AC 10 ms 1148 KB
014.txt AC 11 ms 1148 KB
015.txt AC 10 ms 1148 KB
016.txt AC 11 ms 1148 KB
017.txt AC 10 ms 1148 KB
018.txt AC 10 ms 1148 KB
example0.txt AC 1 ms 256 KB
example1.txt AC 1 ms 256 KB
example2.txt AC 1 ms 256 KB