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>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
const ll mod = 998244353;
#define fi first
#define se second
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(x) x.begin(),x.end()
#define faster ios::sync_with_stdio(false);cin.tie(nullptr)
int main() {
ll N,M,K;
cin >> N >> M >> K;
vector<string> s(N);
rep(i,N){
cin >> s[i];
}
rep(i,N){
bool ok=true;
rep(j,N){
if(i==j) continue;
ll cnt=0;
rep(k,N){
if(s[i][k]!=s[j][k]) cnt++;
}
if(cnt!=K){
ok=false;
break;
}
}
if(ok){
cout << i+1 << endl;
return 0;
}
}
return 0;
}
# | 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... |