-
Notifications
You must be signed in to change notification settings - Fork 0
/
1052.cpp
48 lines (45 loc) · 889 Bytes
/
1052.cpp
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
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
string s;
vector<vector<string>> vec(3);
for(int i=0;i<3;i++)
{
getline(cin,s);
//cout<<s<<endl;
string tmp;
for(int j=0;j<s.size();j++)
{
if(s[j]=='['||s[j]==' ')
{
continue;
}
if(s[j]==']')
{
vec[i].push_back(tmp);
tmp="";
continue;
}
else
tmp+=s[j];
}
}
int n;
cin>>n;
int a,b,c,d,e;
while(n--)
{
cin>>a>>b>>c>>d>>e;
if(a>vec[0].size()||e>vec[0].size()||b>vec[1].size()||d>vec[1].size()||c>vec[2].size()||a<=0||b<=0||c<=0||d<=0||e<=0)
cout<<"Are you kidding me? @\\/@"<<endl;
else
{
cout<<vec[0][a-1]<<"("<<vec[1][b-1]<<vec[2][c-1]<<vec[1][d-1]<<")"<<vec[0][e-1]<<endl;
}
}
return 0;
}