Cod sursa(job #3266324)
Utilizator | Data | 7 ianuarie 2025 14:59:59 | |
---|---|---|---|
Problema | Abc2 | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <bits/stdc++.h>
using namespace std;
string text, word;
unordered_map<string, bool> m;
int main() {
ifstream cin("abc2.in");
ofstream cout("abc2.out");
cin >> text;
while (cin >> word) {
m[word] = true;
}
int ans = 0;
for (int i = 3; i < text.size(); ++i) {
ans += m[text.substr(i - 3, word.size())];
}
cout << ans;
}