Pagini recente » Profil darkseeker | Cod sursa (job #1928881) | Cod sursa (job #2519395) | Profil darkseeker | Cod sursa (job #1595647)
#include <string>
#include <vector>
#include <fstream>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
int N;
vector <int> poz;
string A,B;
int main(){
ifstream f("strmatch.in");
ofstream g("strmatch.out");
f>>A;
f>>B;
size_t ff = B.find(A);
while(ff != string::npos){
if(N <= 1000){
poz.pb(ff);
}
ff = B.find(A, ff+1);
N++;
}
g<<(N < 1000 ? N : 1000)<<'\n';
for(auto it : poz){
g<<it<<' ';
}
}