全wa求调
查看原帖
全wa求调
1041398
ZZZZZhanggggg楼主2025/6/30 14:46
#include<bits/stdc++.h>
using namespace std;
int n,m,len;
string x;
map<string , vector<int> > p;
int main(){
	scanf("%d\n",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&len);
		string s;
		for(int j=1;j<=len;j++){
			cin>>s;
			p[s].push_back(i);
		}
	}
	scanf("%d\n",&m);
	for(int i=1;i<=m;i++){
		cin>>x;
		for(int j=0;j<p[x].size();j++){
			cout<<p[x][j];
			if(j!=p[x].size()-1){
				cout<<" ";
			} 
		}
		if(i!=m)
		cout<<endl;
	}
} 
2025/6/30 14:46
加载中...