| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1340479 | kawhiet | Lozinke (COCI17_lozinke) | C++20 | 178 ms | 16580 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;
for (int i = 0; i < s.size(); i++) {
for (int j = i; j < s.size(); j++) {
cnt[s.substr(i, j - i + 1)]++;
}
}
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... | ||||
