显示代码纯文本
#include<cstdio>
#include<string>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int n,t,p,h,maxx;
const int maxn=20000010;
char b[maxn],s[maxn];
int main(){
freopen("R.in","r",stdin);
freopen("R.out","w",stdout);
for(int i=0;i<=1000000;i++)b[i]='a';
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%s%d",&s,&t);
int tmp=-maxn;h=strlen(s);
for(int j=1;j<=t;j++){
scanf("%d",&p),p--;
maxx=max(p+h,maxx);
for(int k=max(tmp,p);k<p+h;k++)b[k]=s[k-p];
tmp=p+h;
}
}
for(int i=0;i<maxx;i++)printf("%c",b[i]);
return 0;
}