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 |
#include <iostream> #include <sstream> #include <map> #include <string> #include <cstring> #include <queue> using namespace std; map<int,string> mp; int main() { int* arr; string db; int t,n; string str,s1,s2,s3; queue<int> q; getline(cin,str); stringstream ss; ss<<str; ss>>t; getline(cin,str); while(t--) { getline(cin,s1); getline(cin,s2); //q.clear(); ss.clear(); ss<<s1; int mx=0; while(ss>>n) { q.push(n); if(n>mx) mx=n; } mp.clear(); ss.clear(); ss<<s2; while(!q.empty()) { ss>>db; mp[q.front()]=db; q.pop(); } if(t) getline(cin,s3); for(int i=1;i<=mx;i++) { cout<<mp[i]<<"\n"; } if(t) cout<<"\n"; //cout<<double(mp[i]*1.0)<<"\n"; } return 0; } |