Pagini recente » Cod sursa (job #3355899) | Cod sursa (job #3356397) | Cod sursa (job #3314541) | Cod sursa (job #3306372) | Cod sursa (job #3319062)
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops,inline")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#define fast ios_base::sync_with_stdio(0);f.tie(0);g.tie(0);
#define setinf(x) memset(x,0x3f3f3f3f,sizeof(x));
#define set0(x) memset(x,0,sizeof(x));
#define all(x) x.begin(),x.end()
#define pii pair<int,int>
#define INF 0x3f3f3f3f
#define vi vector<int>
#define ll long long
#define vll vector<ll>
#define pb push_back
#define fi first
#define se second
#define DD 100001
#define nl '\n'
using namespace std;
const string file="abc2";
ifstream f(file+".in");
ofstream g(file+".out");
//#define f cin
//#define g cout
char s[10000001];
char t[22];
unordered_set<string>mp;
int main(){
int r=0;
f.getline(s,10000001);
while (f.getline(t,22)) {
string cuv=t;
if (mp.count(cuv)) continue;
mp.insert(cuv);
char *p=strstr(s,t);
while (p) {
++r;
p=strstr(p+1,t);
}
}
g<<r;
system("pause");
return 0;
}