Submission #1309473

#TimeUsernameProblemLanguageResultExecution timeMemory
1309473ayuxhkumxr22Lozinke (COCI17_lozinke)C++20
Compilation error
0 ms0 KiB
/*
Author : ayuxh
*/
#include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include <C:\Users\AYUSH\Desktop\CP\Contest\debug.h>
#endif
#define INF (int)2e9
#define INFL (long long)2e18
#define int long long
const int mod = 998244353;

void Solve() {
    int n;
    cin>>n;
    map<string,int> mp;
    vector<string> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
        mp[v[i]]++;
    }
    int ans=0;
    for(int k=0;k<n;k++){
        set<string> s;
        for(int i=0;i<v[k].size();i++){
            for(int j=i;j<v[k].size();j++){
                string str=v[k].substr(i,j-i+1);
                if(s.find(str)==s.end()){
                    s.insert(str);
                    ans+=mp[str];
                }
            }
        }
    }
    cout<<ans-n<<"\n";
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#ifndef ONLINE_JUDGE
    freopen("inputf.in", "r", stdin);
    freopen("outputf.out", "w", stdout);
#endif
    int t=1;
    // cin >> t;
    while (t--) Solve();
    return 0;
}

Compilation message (stderr)

lozinke.cpp:7:10: fatal error: C:\Users\AYUSH\Desktop\CP\Contest\debug.h: No such file or directory
    7 | #include <C:\Users\AYUSH\Desktop\CP\Contest\debug.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.