QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#790806 | #5254. Differences | thanhlaihoccode | TL | 0ms | 0kb | C++23 | 716b | 2024-11-28 15:26:54 | 2024-11-28 15:26:56 |
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define FOR(i, l, r) for(int i = l; i <= r; i++)
#define FOD(i, l, r) for(int i = l; i >= r; i--)
#define ex exit(0);
const int N = 1e5 + 5;
int n, m, k, d[N];
string s[N];
main(){
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> n >> m >> k;
FOR(i, 1, n) cin >> s[i];
FOR(i, 1, n){
bool ok = true;
FOR(j, 1, n){
if(!ok) break;
if(i == j) continue;
int sum = 0;
FOR(p, 0, m - 1) if(s[i][p] != s[j][p]) sum++;
if(sum != k) ok = false;
}
if(ok){
cout << i; ex;
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Time Limit Exceeded
input:
3585 4096 2048 ABBBBBBAABAAAAAAAAAAAAABAABABBBABABAAAAABABAAAABAABAABBABBAABAABABBABAABBABBABABABBAAAABBABAABBBBABBBAABBBBBABAABAAABAAABBBBAAAABAABAABABABABBBBBABAAABAAABBAABABBABAABBAABBAABABBBBAABAAAABAABBABAAABBAAAAAABAABBABBABAABABBBAABABBABABBBAAAAABBBABABABBAABAAAABBBBABABAABBBABABABBAABBBABAB...