-
Notifications
You must be signed in to change notification settings - Fork 2
/
B1052.cpp
66 lines (64 loc) · 1.12 KB
/
B1052.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<string> express[3];
int main(){
string str;
for(int i = 0; i < 3; ++i){
getline(cin, str);
int j = 0;
while(j < str.length()){
if(str[j] == '['){
++j;
string temp;
while(str[j] != ']' && j < str.length()){
temp += str[j];
++j;
}
if(str[j] == ']')
express[i].push_back(temp);
}
++j;
}
}
int N;
cin >> N;
for(int i = 0; i < N; ++i){
string ans;
bool flag = true;
for(int j = 0; j < 5; ++j){
int t;
cin >> t;
if(j == 0 || j == 4){
if(t <= express[0].size() && t >= 1){
ans += express[0][t-1];
}else{
flag = false;
}
if(j == 0) ans += '(';
}
if(j == 1 || j == 3){
if(t <= express[1].size() && t >= 1){
ans += express[1][t-1];
}else{
flag = false;
}
if(j == 3) ans += ')';
}
if(j == 2){
if(t <= express[2].size() && t >= 1){
ans += express[2][t-1];
}else{
flag = false;
}
}
}
if(flag == false){
cout << "Are you kidding me? @\\/@" << endl;
}else{
cout << ans << endl;
}
}
return 0;
}