Cod sursa(job #2119849)
Utilizator | Data | 1 februarie 2018 18:13:44 | |
---|---|---|---|
Problema | Potrivirea sirurilor | Scor | 14 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.33 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("strmatch.in");
ofstream g("strmatch.out");
string a,b;
int p,sol[1<<22],k;
int main()
{
f >> a >> b;
while(p=b.find(a,p)+1)
sol[++k]=p-1;
g << k << "\n";
// p=0;
while(p<k && p<1000)
g << sol[p++] << " ";
return 0;
}