90pts,TLEon#11(玄关
查看原帖
90pts,TLEon#11(玄关
766934
Bismuth_楼主2024/8/6 16:16
#include <bits/stdc++.h>
using namespace std;
unordered_map<string, int>mp[1145];
int n, l, m;

signed main() {
    ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> l;
		for (int j = 1; j <= l; j++) {
			string s;
			cin >> s;
			mp[i][s] = 1;
		}
	}
	cin >> m;
	for (int i = 1; i <= m; i++) {
		string s;
		cin >> s;
		for (int j = 1; j <= n; j++)
			if (mp[j][s])
				cout << j << " ";
		cout << endl;
	}
	return 0;
}
2024/8/6 16:16
加载中...