Submission #1295110
Source Code Expand
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vint; typedef pair<int,int> pint; typedef vector<pint> vpint; #define rep(i,n) for(int i=0;i<(n);i++) #define REP(i,n) for(int i=n-1;i>=(0);i--) #define reps(i,f,n) for(int i=(f);i<(n);i++) #define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++) #define all(v) (v).begin(),(v).end() #define eall(v) unique(all(v), v.end()) #define pb push_back #define mp make_pair #define fi first #define se second #define chmax(a, b) a = (((a)<(b)) ? (b) : (a)) #define chmin(a, b) a = (((a)>(b)) ? (b) : (a)) const int MOD = 1e9 + 7; const int INF = 1e9; const ll INFF = 1e18; int N; int p[20010]; int a[20010], b[20010]; int main(void){ cin >> N; rep(i, N) cin >> p[i]; rep(i, N) p[i]--; rep(i, N) a[p[i]] = 2 * i + 1; rep(i, N) b[p[i]] = INF - i; rep(i, N)printf("%d ", a[i]); printf("\n"); rep(i, N)printf("%d ", b[i]); printf("\n"); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Construct Sequences |
User | mmxsrup |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 996 Byte |
Status | WA |
Exec Time | 12 ms |
Memory | 768 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 | WA | 2 ms | 256 KB |
001.txt | WA | 2 ms | 256 KB |
002.txt | WA | 2 ms | 256 KB |
003.txt | WA | 1 ms | 256 KB |
004.txt | WA | 2 ms | 256 KB |
005.txt | WA | 11 ms | 768 KB |
006.txt | WA | 3 ms | 384 KB |
007.txt | WA | 10 ms | 768 KB |
008.txt | WA | 6 ms | 512 KB |
009.txt | WA | 11 ms | 768 KB |
010.txt | WA | 11 ms | 768 KB |
011.txt | WA | 11 ms | 768 KB |
012.txt | WA | 11 ms | 768 KB |
013.txt | WA | 11 ms | 768 KB |
014.txt | WA | 12 ms | 768 KB |
015.txt | WA | 11 ms | 768 KB |
016.txt | WA | 11 ms | 768 KB |
017.txt | WA | 12 ms | 768 KB |
018.txt | WA | 11 ms | 768 KB |
example0.txt | AC | 1 ms | 256 KB |
example1.txt | WA | 1 ms | 256 KB |
example2.txt | WA | 1 ms | 256 KB |