Submission #1866779
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)
template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}
using Pi = pair<int, int>;
using Ti = tuple<int, int, int>;
using vint = vector<int>;
const int inf = 1LL << 55;
const int mod = 1e9 + 7;
signed main()
{
cin.tie(0);
ios_base::sync_with_stdio(0);
cout << fixed << setprecision(12);
const int L = 50000;
int N;
cin >> N;
++N;
vint p(N);
reps(i, 1, N) cin >> p[i];
vint a(N);
vint b(N);
reps(i, 1, N) {
a[i] = L*i;
b[i] = L*(N-i);
}
reps(i, 1, N) a[p[i]] += i;
/*
reps(i, 1, N) {
cout << a[p[i]]+b[p[i]] << endl;
}
*/
reps(i, 1, N) cout << a[i] << " \n"[i==N-1];
reps(i, 1, N) cout << b[i] << " \n"[i==N-1];
return 0;
}
Submission Info
Submission Time |
|
Task |
B - Construct Sequences |
User |
ukuku09 |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
1071 Byte |
Status |
WA |
Exec Time |
6 ms |
Memory |
1152 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
0 / 400 |
Status |
|
|
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 |
1 ms |
256 KB |
002.txt |
AC |
1 ms |
256 KB |
003.txt |
AC |
1 ms |
256 KB |
004.txt |
AC |
1 ms |
384 KB |
005.txt |
AC |
6 ms |
1152 KB |
006.txt |
AC |
2 ms |
384 KB |
007.txt |
AC |
6 ms |
1024 KB |
008.txt |
AC |
4 ms |
640 KB |
009.txt |
AC |
6 ms |
1024 KB |
010.txt |
WA |
6 ms |
1152 KB |
011.txt |
WA |
6 ms |
1152 KB |
012.txt |
WA |
6 ms |
1152 KB |
013.txt |
WA |
6 ms |
1152 KB |
014.txt |
WA |
6 ms |
1152 KB |
015.txt |
WA |
6 ms |
1152 KB |
016.txt |
WA |
6 ms |
1152 KB |
017.txt |
WA |
6 ms |
1152 KB |
018.txt |
WA |
6 ms |
1152 KB |
example0.txt |
AC |
1 ms |
256 KB |
example1.txt |
AC |
1 ms |
256 KB |
example2.txt |
AC |
1 ms |
256 KB |