# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
222930 | baoduytran0104 | Lozinke (COCI17_lozinke) | C++14 | 1099 ms | 1152 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, l, t;
string s[20005], a;
int main()
{
cin >> n;
for(int i = 1; i <= n; ++i) cin >> s[i];
for(int i = 1; i <= n; ++i) {
l = s[i].length();
for(int j = 1; j <= n; ++j) {
if (i == j) continue;
if (l > s[j].length()) continue;
for(int k = 0; k <= int(s[j].length() - l); ++k) {
a = s[j].substr(k, l);
if (a == s[i]) {
t += 1;
break;
}
}
}
}
cout << t;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |