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;
const int N=4150;
int n,m,k,cnt;
string s;
bitset<4100> bs[N];
int main(){
cin>>n>>m>>k;
for (int i=1;i<=n;i++){
cin>>s;
for (int j=0;j<m;j++) bs[i][j]=(s[j]=='A');
}
for (int i=1;i<=n;i++){
for (int j=1;j<=n;j++){
if (i==j) continue;
cnt=(bs[i]^bs[j]).count();
if (cnt!=k) goto skip;
}
cout<<i<<"\n";
return 0;
skip:;
}
}
# | 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... |