Cod sursa(job #3378741)
| Utilizator | Data | 27 noiembrie 2026 21:15:44 | |
|---|---|---|---|
| Problema | Abc2 | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("abc2.in");
ofstream fout("abc2.out");
string s,x;
unordered_map<string, int> m;
int ans,l;
int main()
{
fin>>s;
while (fin>>x)
{
l=x.length();
m[x]++;
}
for (int i=0;i<=(int)s.length()-l;i++)
{
string window=s.substr(i, l);
if (m.count(window))
ans++;
}
fout<<ans;
return 0;
}
