Cod sursa(job #3319152)
| Utilizator | Data | 30 octombrie 2025 18:55:45 | |
|---|---|---|---|
| Problema | Abc2 | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <iostream>
#include<fstream>
#include<cstring>
#include<set>
using namespace std;
int n,i,x,op;
ifstream fcin("hashuri.in");
ofstream fcout("hashuri.out");
char text[10000000],lit[20];
int k;
int main()
{
set<string> s;
fcin.getline(text,10000000);
while(fcin>>lit)
{
if(s.count(string(lit)))continue;
s.insert(string(lit));
char *p=text;
while((p=strstr(p,lit))!=NULL)
{
++k;
p=p+strlen(lit);
}
}
cout<<k;
}
