Pagini recente » Cod sursa (job #2382742) | Cod sursa (job #369971) | Cod sursa (job #1786561) | Cod sursa (job #1415673) | Cod sursa (job #3136950)
#include <bits/stdc++.h>
#define optim ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define let auto
#define popcount __builtin_popcount
#define ctzll __builtin_ctzll
#define clzll __builtin_clzll
using namespace std;
ifstream fin("strmatch.in");
ofstream fout("strmatch.out");
const int sze = 2e6;
char a[sze + 1];
char b[sze + 1];
int v[sze + 1];
int n = 0;
let main() -> int
{
fin>>a>>b;
int sb = strlen(b);
int sa = strlen(a);
for(int i = 0;i < sb;++i) {
int j = i;
while(b[j] == a[j - i] && j < sb){
j++;
}
if(j - i == sa) v[++n] = i;
}
fout<<n<<'\n';
n = min(n, 1000);
for(int i = 1;i<=n;++i) fout<<v[i]<<' ';
return 0;
}