QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#790806#5254. DifferencesthanhlaihoccodeTL 0ms0kbC++23716b2024-11-28 15:26:542024-11-28 15:26:56

Judging History

你现在查看的是最新测评结果

  • [2024-11-28 15:26:56]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2024-11-28 15:26:54]
  • 提交

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...

output:


result: