Cod sursa(job #2633177)
Utilizator | Data | 6 iulie 2020 17:35:39 | |
---|---|---|---|
Problema | Potrivirea sirurilor | Scor | 80 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.29 kb |
#include <fstream>
std::ifstream fin ("strmatch.in");
std::ofstream fout ("strmatch.out");
int x, p, sol[1 << 22];
std::string A, B;
int main () {
for (fin >> A >> B; p = B.find (A, p) + 1; sol[x ++] = p - 1);
for (fout << x << '\n'; p < x & p < 1000; fout << sol[p ++] << ' ');
}