Submission #1694458
Source Code Expand
#include <bits/stdc++.h> #define ll long long #define INF 1000000005 #define MOD 1000000007 #define EPS 1e-10 #define rep(i,n) for(int i=0;i<(int)(n);++i) #define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i) #define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i) #define each(a,b) for(auto (a): (b)) #define all(v) (v).begin(),(v).end() #define len(v) (int)(v).size() #define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end()) #define cmx(x,y) x=max(x,y) #define cmn(x,y) x=min(x,y) #define fi first #define se second #define pb push_back #define show(x) cout<<#x<<" = "<<(x)<<endl #define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl #define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl #define sset(s) cout<<#s<<":";each(kbrni,s)cout<<" "<<kbrni;cout<<endl #define smap(m) cout<<#m<<":";each(kbrni,m)cout<<" {"<<kbrni.first<<":"<<kbrni.second<<"}";cout<<endl using namespace std; typedef pair<int,int> P; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vl; typedef vector<double> vd; typedef vector<P> vp; const int MAX_N = 100005; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<int> vec(n); rep(i,n){ cin >> vec[i]; vec[i]--; } vector<int> a(n),b(n); rep(i,n){ a[i] = n*(i+1); b[i] = n*(n-i); } rep(i,n){ a[vec[i]] += i; } rep(i,n){ cout << a[i] << " "; } cout << "\n"; rep(i,n){ cout << b[i] << " "; } cout << "\n"; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Construct Sequences |
User | kopricky |
Language | C++14 (GCC 5.4.1) |
Score | 400 |
Code Size | 1607 Byte |
Status | AC |
Exec Time | 6 ms |
Memory | 896 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 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 | 2 ms | 256 KB |
002.txt | AC | 2 ms | 256 KB |
003.txt | AC | 1 ms | 256 KB |
004.txt | AC | 2 ms | 256 KB |
005.txt | AC | 6 ms | 896 KB |
006.txt | AC | 2 ms | 384 KB |
007.txt | AC | 6 ms | 768 KB |
008.txt | AC | 4 ms | 512 KB |
009.txt | AC | 6 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 | 6 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 |