Pagini recente » Cod sursa (job #1031458) | Borderou de evaluare (job #1567643) | Cod sursa (job #2356303) | Cod sursa (job #43838) | Cod sursa (job #2675031)
#include <fstream>
#include <deque>
#include <vector>
#include <bitset>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <limits.h>
#include <cstring>
#include <cstring>
#define MOD 1234
using namespace std ;
ifstream cin ("strmatch.in") ;
ofstream cout ("strmatch.out") ;
string a, b ;
vector<int> v ;
int main()
{
cin >> a >> b ;
int s = 0 ;
char *ptr = &b[0] ;
while(strstr(ptr, &a[0]))
{
s ++ ;
ptr = strstr(ptr, &a[0]) + 1 ;
if(ptr)v.push_back(ptr - &b[0]) ;
}
cout << v.size() << endl ;
for(int f = 0 ; f < v.size() ; f ++)
cout << v[f] - 1 << " " ;
return 0 ;
}