# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
152098 | Runtime_error_ | Lozinke (COCI17_lozinke) | C++14 | 533 ms | 16644 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int inf = 2e4+9;
map<string,int> mp;
vector<string> v;
int main(){
int n,ans = 0;
cin>>n;
for(int i=1;i<=n;i++){
string tmp;
set<string> s;
cin>>tmp;
for(int j=0;j<tmp.size();j++){
string cur = "";
for(int z=j;z<tmp.size();z++)
cur += tmp[z],s.insert(cur);
}
v.push_back(tmp);
for(auto o:s)
mp[o] ++;
}
for(auto o:v)
ans += mp[o]-1;
cout<<ans<<endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |