Cod sursa(job #3287621)
Utilizator | Data | 18 martie 2025 18:52:39 | |
---|---|---|---|
Problema | Potrivirea sirurilor | Scor | 80 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.38 kb |
// 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++] << ' ';
}