# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
954191 | Alan | Genetics (BOI18_genetics) | C++17 | 9 ms | 8652 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;
string s[4105], t[4105];
map<string, int> mp;
bool bad[4105];
int diff (int x, int y) {
int cnt = 0;
for (int i = 0; i < (int) s[x].size(); i++) cnt += s[x][i] != s[y][i];
return cnt;
}
int main () {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m, k;
cin >> n >> m >> k;
for (int i = 1; i <= n; i++) {
cin >> s[i];
mp[s[i]]++;
}
for (int i = 1; i <= n; i++) if (mp[s[i]] > 1) bad[i] = true;
deque<int> dq;
for (int i = 1; i <= n; i++) if (!bad[i]) {
while (i <= n && !dq.empty() && diff(dq.back(), i) != k) {
i++;
dq.pop_back();
}
if (i > n) break;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |