Submission #978923
Source Code Expand
#include <vector> #include <iostream> #include <unordered_map> #include <map> #include <iomanip> #include <functional> #include <algorithm> #include <cassert> #include <cmath> #include <string> #include <sstream> #include <queue> using namespace std; #define x first #define y second #define ll long long #define ld long double #define pii pair<int,int> #define wh(x) (x).begin(),(x).end() #define ri(x) int x;cin>>x; #define rii(x,y) int x,y;cin>>x>>y; #define rl(x) ll x;cin>>x; #define rv(v) for(auto&_cinv:v) cin>>_cinv; #define wv(v) for(auto&_coutv:v) cout << _coutv << ' '; cout << endl; #define ev(v) for(auto&_cerrv:v) cerr << _cerrv << ' '; cerr << endl; #define MOD 1000000007 namespace std { template<typename T,typename U>struct hash<pair<T,U>>{hash<T>t;hash<U>u;size_t operator()(const pair<T,U>&p)const{return t(p.x)^(u(p.y)<<7);}}; } template<typename T,typename F>T bsh(T l,T h,const F&f){T r=-1,m;while(l<=h){m=(l+h)/2;if(f(m)){l=m+1;r=m;}else{h=m-1;}}return r;} template<typename T,typename F>T bsl(T l,T h,const F&f){T r=-1,m;while(l<=h){m=(l+h)/2;if(f(m)){h=m-1;r=m;}else{l=m+1;}}return r;} template<typename T> T gcd(T a,T b) { if (a<b) swap(a,b); return b?gcd(b,a%b):a; } int main(int,char**) { ios_base::sync_with_stdio(false); int N; cin >> N; vector<int> P(N); for (int i = 0; i < N; i++) { int c; cin >> c; P[c-1] = i; } for (int i = 0; i < N; i++) { cout << i*N + 1 << ' '; } cout << endl; for (int i = 0; i < N; i++) { cout << (N-i)*N + 1 + P[i] << ' '; } cout << endl; }
Submission Info
Submission Time | |
---|---|
Task | B - Construct Sequences |
User | majk |
Language | C++14 (GCC 5.4.1) |
Score | 400 |
Code Size | 1630 Byte |
Status | AC |
Exec Time | 8 ms |
Memory | 768 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 | 3 ms | 256 KB |
001.txt | AC | 3 ms | 256 KB |
002.txt | AC | 3 ms | 256 KB |
003.txt | AC | 3 ms | 256 KB |
004.txt | AC | 3 ms | 256 KB |
005.txt | AC | 8 ms | 768 KB |
006.txt | AC | 4 ms | 384 KB |
007.txt | AC | 7 ms | 640 KB |
008.txt | AC | 5 ms | 512 KB |
009.txt | AC | 7 ms | 640 KB |
010.txt | AC | 8 ms | 768 KB |
011.txt | AC | 8 ms | 768 KB |
012.txt | AC | 8 ms | 768 KB |
013.txt | AC | 8 ms | 768 KB |
014.txt | AC | 8 ms | 768 KB |
015.txt | AC | 8 ms | 768 KB |
016.txt | AC | 8 ms | 768 KB |
017.txt | AC | 8 ms | 768 KB |
018.txt | AC | 8 ms | 768 KB |
example0.txt | AC | 2 ms | 256 KB |
example1.txt | AC | 2 ms | 256 KB |
example2.txt | AC | 2 ms | 256 KB |