Pagini recente » Diferente pentru problema/supermario intre reviziile 16 si 8 | Cod sursa (job #1170121) | Cod sursa (job #1302440) | Cod sursa (job #1510445) | Cod sursa (job #3233819)
#include<bits/stdc++.h>
std::ifstream fin("strmatch.in");
std::ofstream fout("strmatch.out");
char A[2000001], B[2000001];
std::vector<int> ap;
int main(){
fin >> A >> B;
char* p = strstr(B, A);
while(p){
ap.push_back(p - B);
p = strstr(p + 1, A);
}
fout << ap.size() << '\n';
for(const int& x : ap)
fout << x << ' ';
}