Pagini recente » Cod sursa (job #1792669) | Cod sursa (job #1721936) | Cod sursa (job #1352411) | Diferente pentru problema/countfefete intre reviziile 8 si 7 | Cod sursa (job #3287621)
// test of Emil Centiu's golfing solution on new test cases
#include <bits/stdc++.h>
int x, p, s[1 << 22];
std::string a, b = "strmatch.";
int main()
{
std::ifstream f(b + "in");
std::ofstream g(b + "out");
f >> a >> b;
while (p = b.find(a, p) + 1)
s[x++] = p - 1;
g << x << '\n';
while (p < x & p < 1000)
g << s[p++] << ' ';
}