Cod sursa(job #2301515)
Utilizator | Data | 13 decembrie 2018 01:13:17 | |
---|---|---|---|
Problema | Potrivirea sirurilor | Scor | 80 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.37 kb |
#include <iostream>
#include <fstream>
#include <cstring>
#define Nmax 2000005
using namespace std;
ifstream f("strmatch.in");
ofstream g("strmatch.out");
string a, b;
int p;
int n, s[1<<23];
int main()
{
f >> a >> b;
while(p=b.find(a,p)+1)
s[n++]=p-1;
g << n << '\n';
while(p<n && p<1000)
g << s[p++]<<' ';
return 0;
}