QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#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;
}
详细
Test #1:
score: 0
Time Limit Exceeded
input:
3585 4096 2048 ABBBBBBAABAAAAAAAAAAAAABAABABBBABABAAAAABABAAAABAABAABBABBAABAABABBABAABBABBABABABBAAAABBABAABBBBABBBAABBBBBABAABAAABAAABBBBAAAABAABAABABABABBBBBABAAABAAABBAABABBABAABBAABBAABABBBBAABAAAABAABBABAAABBAAAAAABAABBABBABAABABBBAABABBABABBBAAAAABBBABABABBAABAAAABBBBABABAABBBABABABBAABBBABAB...