P1628 合并序列
点击查看代码
#include<bits/stdc++.h>
using namespace std;
int n;
priority_queue<string,vector<string>,greater<string>> hp,res;
int main()
{
cin>>n;
while(n--){
string s;
cin>>s;
hp.push(s);
}
string t;
cin>>t;
while(!hp.empty()){
string s=hp.top();
hp.pop();
if(s.find(t)==0) res.push(s);
}
while(!res.empty()){
cout<<res.top()<<endl;
res.pop();
}
return 0;
}

浙公网安备 33010602011771号