Cod sursa(job #3319061)

Utilizator ioanxhIoan Budeanu ioanxh Data 30 octombrie 2025 13:45:29
Problema Abc2 Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.98 kb
#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];
map<string,int>mp;
int main(){
    int r=0;
    f.getline(s,1000001);
    while (f.getline(t,22)) {
        mp[t]++;
        if (mp[t]==1) {
            char *p=strstr(s,t);
            while (p) {
                ++r;
                p=strstr("\0",t);
            }
        }
    }
    g<<r;
    system("pause");
    return 0;
}