#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, m, k; cin>>n>>m>>k;
vector<string> s(n + 1);
for (int i = 1; i <= n; i++){
cin>>s[i];
}
auto f = [&](int i, int j){
int cnt = 0;
for (int x = 0; x < m; x++){
cnt += (s[i][x] != s[j][x]);
}
return (cnt == k);
};
vector<bool> bad(n + 1);
for (int i = 1; i <= n; i++){
for (int j = 1; j <= n; j++){
if (i == j || (bad[i] && bad[j])) continue;
if (!f(i, j)){
bad[i] = bad[j] = 1;
}
}
}
for (int i = 1; i <= n; i++){
if (!bad[i]){
cout<<i<<"\n";
}
}
}
# | 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... |