# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
116807 | 2019-06-14T01:22:22 Z | ntrung03 | Lozinke (COCI17_lozinke) | C++17 | 0 ms | 0 KB |
#include <bits/stdc++.h> using namespace std; string s[20002]; int main(int argc, char *argv[]) { ios_base::sync_with_stdio(false) int n; cin>>n; int res = 0; for(int i=0;i<n;i++) cin>>s[i]; for(int i=0;i<n;i++) for(int j=0;j<n;j++) if(i!=j&&s[i].find(s[j])!=string::npos){ res++; } cout<<res<<endl; }