# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
44579 | heon | Lozinke (COCI17_lozinke) | C++11 | 594 ms | 17804 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<iostream>
#include<map>
#include<set>
using namespace std;
#define MAXN 20005
int n;
string arr[MAXN];
map <string,int> mp;
set <string> v;
int sol = 0;
int main(){
cin >> n;
for(int i = 0; i < n; i++){
cin >> arr[i];
v.clear();
for(int j = 0; j < arr[i].size(); j++){
string curr;
for(int l = j; l < arr[i].size(); l++){
curr.push_back(arr[i][l]);
v.insert(curr);
}
}
for(auto& j : v){
mp[j]++;
}
}
for(auto& x : arr){
sol += mp[x];
}
cout << sol - n;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |