Submission #472768

#TimeUsernameProblemLanguageResultExecution timeMemory
472768_L__Lozinke (COCI17_lozinke)C++17
40 / 100
1090 ms844 KiB
// This code is written by _L__
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<class T> using ordered_set = tree<T, null_type , less<T> , rb_tree_tag , tree_order_statistics_node_update>;
#define endl '\n'
#define F_word ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
typedef long long ll;
typedef long double ld;
const ll mod = 1e9+7, N = 1e5+300, inf = 1e18;
const ld E = 1e-6;
#define ff first
#define ss second

int main(void){
    F_word;
    int n; cin >> n;
    string arr[n]; for(int i = 0; i < n; ++i) cin >> arr[i];
    ll ans = 0;
    for(int i = 0; i < n; ++i){
        for(int j = 0; j < n; ++j){
            if(i == j) continue;
            if(arr[j].find(arr[i]) != string::npos)++ans;
        }
    }
    cout << ans << endl;
}
#Verdict Execution timeMemoryGrader output
Fetching results...