| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1340480 | kawhiet | Lozinke (COCI17_lozinke) | C++20 | 237 ms | 16448 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<string> a;
map<string, int> cnt;
for (int _ = 0; _ < n; _++) {
string s;
cin >> s;
set<string> t;
for (int i = 0; i < s.size(); i++) {
for (int j = i; j < s.size(); j++) {
t.insert(s.substr(i, j - i + 1));
}
}
for (auto x : t) {
cnt[x]++;
}
a.push_back(s);
}
int ans = 0;
for (auto x : a) {
ans += cnt[x] - 1;
}
cout << ans << '\n';
return 0;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
