/***
Md. Namzul Hasan
Shahjalal University of Science & Technology,Sylhet.
hasan08sust@gmail.com
***/
#include<iostream>
#include<cstdio>
#include<stack>
#include<queue>
#include<map>
#include<vector>
#include<algorithm>
#include<cstring>
#include<sstream>
#include<cmath>
using namespace std ;
typedef long long ll ;
typedef int in ;
typedef unsigned long long ull ;
const double pi = 2*acos(0) ;
#define maxi 40000
#define pf printf
#define sc scanf
#define pb push_back
#define MEM(x,y) (memset((x),(y),sizeof(x)))
#define MIN(x,y) ((x) < (y) ? (x) : (y))
#define MAX(x,y) ((x) > (y) ? (x) : (y))
#define load(array,size) for(int i=0 ; i<size ; i++) cin>>array[i] ;
#define new_line pf("\n")
#define clear_data(array) memset(array,0,sizeof(array))
#define highest_int 2147483647
int main()
{
int test,i,invalue,v1 ;
string str1, str2,t,v2 ;
vector<int>data;
vector<string>strdata ;
vector< pair<int,string> > result ;
sc("%d",&test);
getchar();
while(test--){
getchar();
getline(cin,str1);
stringstream ss(str1);
while(ss>>invalue)
data.pb(invalue);
getline(cin,str2);
stringstream sst(str2);
while(sst>>t)
strdata.pb(t);
for(int i=0; i<data.size(); i++){
v1 = data[i];
v2 = strdata[i];
result.pb(make_pair(v1,v2));
}
sort(result.begin(),result.end());
for(int i=0;i<result.size();i++){
cout<<result[i].second<<endl;
}
data.clear();
strdata.clear();
result.clear();
if(test)
pf("\n");
}
return 0;
}
Md. Namzul Hasan
Shahjalal University of Science & Technology,Sylhet.
hasan08sust@gmail.com
***/
#include<iostream>
#include<cstdio>
#include<stack>
#include<queue>
#include<map>
#include<vector>
#include<algorithm>
#include<cstring>
#include<sstream>
#include<cmath>
using namespace std ;
typedef long long ll ;
typedef int in ;
typedef unsigned long long ull ;
const double pi = 2*acos(0) ;
#define maxi 40000
#define pf printf
#define sc scanf
#define pb push_back
#define MEM(x,y) (memset((x),(y),sizeof(x)))
#define MIN(x,y) ((x) < (y) ? (x) : (y))
#define MAX(x,y) ((x) > (y) ? (x) : (y))
#define load(array,size) for(int i=0 ; i<size ; i++) cin>>array[i] ;
#define new_line pf("\n")
#define clear_data(array) memset(array,0,sizeof(array))
#define highest_int 2147483647
int main()
{
int test,i,invalue,v1 ;
string str1, str2,t,v2 ;
vector<int>data;
vector<string>strdata ;
vector< pair<int,string> > result ;
sc("%d",&test);
getchar();
while(test--){
getchar();
getline(cin,str1);
stringstream ss(str1);
while(ss>>invalue)
data.pb(invalue);
getline(cin,str2);
stringstream sst(str2);
while(sst>>t)
strdata.pb(t);
for(int i=0; i<data.size(); i++){
v1 = data[i];
v2 = strdata[i];
result.pb(make_pair(v1,v2));
}
sort(result.begin(),result.end());
for(int i=0;i<result.size();i++){
cout<<result[i].second<<endl;
}
data.clear();
strdata.clear();
result.clear();
if(test)
pf("\n");
}
return 0;
}
No comments:
Post a Comment