# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
116838 | hungcung | Lozinke (COCI17_lozinke) | C++14 | 270 ms | 15288 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;
int n;
string l[20014];
unordered_set<string> s;
unordered_map<string, int> cnt;
int main(void) {
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> l[i];
s.clear();
for (int j = 0; j < (int) l[i].size(); ++j) {
string a;
for (int k = j; k < (int) l[i].size(); ++k) {
a.push_back(l[i][k]);
s.insert(a);
}
}
for (auto &x : s)
cnt[x]++;
}
int sol = 0;
for (auto &x : l)
sol += cnt[x];
cout << sol - n << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |