Cod sursa(job #1798568)
Utilizator | Data | 5 noiembrie 2016 12:03:26 | |
---|---|---|---|
Problema | Abc2 | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream>
#include <fstream>
using namespace std;
string s,n;
int a[10000000],k,nr;
int main()
{
ifstream f("abc2.in");
ofstream g("abc2.out");
f>>s;
nr=0;
k=s.length();
while(f>>n)
{
long long p=s.find(n);
if(p<k)
if(a[p]==0)
{
nr++;
a[p]=1;
}
}
g<<nr;
}