1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| #include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<cstdlib> #include<algorithm> #include<ctime> #include<iomanip> #include<queue> #include<stack> #include<map> #include<vector> #include<ext/rope> #define gh() getchar() #define re register #define underMax(x,y) ((x)>(y)?(x):(y)) #define underMin(x,y) ((x)<(y)?(x):(y)) typedef long long ll; using namespace std; using namespace __gnu_cxx; const int MAXN=1e6+1; template<class T> inline void underRead(T &x) { x=0; char ch=gh(),t=0; while(ch<'0'||ch>'9') t|=ch=='-',ch=gh(); while(ch>='0'&&ch<='9') x=(x<<3)+(x<<1)+(ch^48),ch=gh(); if(t) x=-x; } int N,M,x; string t[MAXN<<1]; rope<int>R; int main() { underRead(N); for(re int i=1;i<=N;++i) { cin>>t[R.size()]; R.push_back(R.size()); } underRead(N); for(re int i=1;i<=N;++i) { cin>>t[R.size()]; underRead(x); R.insert(x,R.size()); } underRead(N); for(re int i=1;i<=N;++i) { underRead(x); cout<<t[R[x]]<<endl; } return 0; }
|