-
Notifications
You must be signed in to change notification settings - Fork 0
/
DANHSACHTHUCTAP2.cpp
56 lines (56 loc) · 1.24 KB
/
DANHSACHTHUCTAP2.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
#pragma GCC Optimize("O3")
#include<bits/stdc++.h>
#include<string>
#include<vector>
#define endl '\n'
#define alphaa "abcdefghijklmnopqrstuvwxyz"
#define ALPHAA "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define f(i,a,b) for(int i=a;i<=b;i++)
#define f1(i,n) for(int i=1;i<=n;i++)
#define f0(i,n) for(int i=0;i<n;i++)
#define ff(i,b,a) for(int i=b;i>=a;i--)
#define sp(x) cout<<x<<" "
#define en(x) cout<<x<<endl
#define el cout<<'\n'
#define fi first
#define se second
#define pb push_back
#define pk pop_back
#define pii pair<int,int>
#define pll pair<ll,ll>
using namespace std;
typedef long long ll;
const int N=1e6+3;
const int MOD=1e9+7;
int n,q;
struct sv
{
string ma,ten,lop,mail,cty;
int stt;
};
bool ss(sv a,sv b) {return a.ma<b.ma;}
int main()
{
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
cin>>n;
struct sv a[n];
f0(i,n)
{
cin>>a[i].ma;
cin.ignore();
getline(cin,a[i].ten);
cin>>a[i].lop>>a[i].mail>>a[i].cty;
a[i].stt=i+1;
}
sort(a,a+n,ss);
cin>>q;
f1(i,q)
{
string s;
cin>>s;
f0(i,n)
{
if(a[i].cty==s) cout<<a[i].stt<<' '<<a[i].ma<<' '<<a[i].ten<<' '<<a[i].lop<<' '<<a[i].mail<<' '<<a[i].cty<<'\n';
}
}
}