0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-24 10:48:48 +00:00

P3879 [TJOI2010] 阅读理解

R44305668
This commit is contained in:
Baoshuo Ren 2020-12-27 14:48:42 +08:00 committed by Baoshuo Ren
parent 9c20446432
commit c3518c7095
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

33
problem/P3879/P3879.cpp Normal file
View File

@ -0,0 +1,33 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, l;
string s;
map<string, vector<int>> m;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> l;
for (int j = 0; j < l; j++) {
cin >> s;
m[s].push_back(i);
}
}
cin >> n;
for (int i = 0; i < n; i++) {
cin >> s;
if (!m.count(s)) {
cout << endl;
}
else {
for (int j = 0; j < m[s].size() - 1; j++) {
if(m[s][j] != m[s][j+1]) {
cout << m[s][j] << ' ';
}
}
cout << *--m[s].end() << endl;
}
}
return 0;
}