Submission #933110

#TimeUsernameProblemLanguageResultExecution timeMemory
933110dubious_dudeLozinke (COCI17_lozinke)C++17
0 / 100
1074 ms1368 KiB
#include <bits/stdc++.h>
using namespace std;
#define fast_io cin.tie(0)->sync_with_stdio(false);

int main() {
    fast_io;

    int n; cin >> n;
    vector<string> pass(n);
    for(int i=0; i<n; i++) cin >> pass[i];

    int cnt = 0;
    for(int i=0; i<n; i++) {
        for(int j=i+1; j<n; j++) {
            if(pass[i].find(pass[j]) != pass[i].npos || pass[j].find(pass[i]) != pass[j].npos) {
                cnt++;
            }
        }
    }

    cout << cnt;

    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...