Submission #1444553


Source Code Expand

// This amazing code is by Eric Sunli Chen.
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
template<typename T> void get_int(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(; (t>'9'||t<'0')&&t!='-'; t=getchar());
	if(t=='-')neg=true,t=getchar();
	for(; t<='9'&&t>='0'; t=getchar())x=x*10+t-'0';
	if(neg)x=-x;
}
template<typename T> void print_int(T x)
{
	if(x<0)putchar('-'),x=-x;
	short a[20]= {},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1; i>=0; i--)putchar('0'+a[i]);
}
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define get1(a) get_int(a)
#define get2(a,b) get1(a),get1(b)
#define get3(a,b,c) get1(a),get2(b,c)
#define printendl(a) print_int(a),puts("")
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
const int inf=0x3f3f3f3f;
const LL Linf=1ll<<61;
const double pi=acos(-1.0);

int a[20111],n,b[20111],p[20111];
int main()
{
	get1(n);
	for(int i=1;i<=n;i++)
	{
		get1(p[i]);
		a[p[i]]=p[i]*30000;
		b[p[i]]=(n-p[i]+1)*30000+i;
	}
	for(int i=1;i<=n;i++)printf("%d ",a[i]);puts("");
	for(int i=1;i<=n;i++)printf("%d ",b[i]);puts("");
	return 0;
}

Submission Info

Submission Time
Task B - Construct Sequences
User OhWeOnFire
Language C++14 (GCC 5.4.1)
Score 400
Code Size 1465 Byte
Status AC
Exec Time 6 ms
Memory 896 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 256 KB
001.txt AC 1 ms 256 KB
002.txt AC 1 ms 256 KB
003.txt AC 1 ms 256 KB
004.txt AC 1 ms 256 KB
005.txt AC 6 ms 896 KB
006.txt AC 2 ms 384 KB
007.txt AC 5 ms 768 KB
008.txt AC 3 ms 512 KB
009.txt AC 5 ms 896 KB
010.txt AC 6 ms 896 KB
011.txt AC 6 ms 896 KB
012.txt AC 6 ms 896 KB
013.txt AC 6 ms 896 KB
014.txt AC 6 ms 896 KB
015.txt AC 5 ms 896 KB
016.txt AC 6 ms 896 KB
017.txt AC 6 ms 896 KB
018.txt AC 6 ms 896 KB
example0.txt AC 1 ms 256 KB
example1.txt AC 1 ms 256 KB
example2.txt AC 1 ms 256 KB