QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#135670 | #5254. Differences | viniciuslettieri# | TL | 0ms | 0kb | C++20 | 841b | 2023-08-05 21:14:00 | 2023-08-05 21:14:02 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int n, m, k;
cin>>n>>m>>k;
vector<int>id(n);
iota(id.begin(), id.end(), 0);
shuffle(id.begin(), id.end(), rng);
vector<string>s(n);
for(int i=0;i<n;i++) cin>>s[i];
for(int i=0;i<n;i++){
int x = id[i];
bool ok = true;
for(int j=0;j<n;j++){
if(i == j) continue;
int y = id[j];
int cnt = 0;
for(int l=0;l<m;l++){
cnt += s[x][l] != s[y][l];
}
if(cnt != k){
ok = false;
break;
}
}
if(ok) cout<<x+1<<"\n";
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Time Limit Exceeded
input:
3585 4096 2048 ABBBBBBAABAAAAAAAAAAAAABAABABBBABABAAAAABABAAAABAABAABBABBAABAABABBABAABBABBABABABBAAAABBABAABBBBABBBAABBBBBABAABAAABAAABBBBAAAABAABAABABABABBBBBABAAABAAABBAABABBABAABBAABBAABABBBBAABAAAABAABBABAAABBAAAAAABAABBABBABAABABBBAABABBABABBBAAAAABBBABABABBAABAAAABBBBABABAABBBABABABBAABBBABAB...