4398. 查询字符串(acwing)


这道题因为每个字符串长度很小 我们直接就分解每个字符串的子串

还是很基础的 如果数据开大一点难度又会上升一个阶段

这个题连用了三道STL map vector set

#include
using namespace std;
#define lowbit(x) x&(-x)
#define ll long long
const int maxn=1e4+5;
mapmp;
setQ[maxn*36];
int n,q,cnt;
string s[maxn],t;
int vis[maxn];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>s[i];
		for(int k=0;k>q;
	while(q--){
	  cin>>t;
	if(!mp[t])
	cout<<"0 -"<
STL