Pagini recente » Cod sursa (job #3282242) | Cod sursa (job #3284570) | Cod sursa (job #2577871) | Cod sursa (job #321031) | Cod sursa (job #2617300)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mxN=1000001;
string a,b;
int main()
{
ifstream cin("strmatch.in");
ofstream cout("strmatch.out");
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin>>a>>b;
vector <int> res;
size_t poz = b.find(a);
if (poz!=-1) res.push_back(poz);
else return cout<<0,0;
while(1){
poz = b.find(a,poz+1);
if (poz==-1) break;
else {
res.push_back(poz);
}
}
cout<<res.size()<<"\n";
int k=res.size();
for (int i=0; i<min(1000,k); i++)
cout<<res[i]<<" ";
return 0;
}