QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#135670#5254. Differencesviniciuslettieri#TL 0ms0kbC++20841b2023-08-05 21:14:002023-08-05 21:14:02

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-05 21:14:02]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2023-08-05 21:14:00]
  • 提交

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

output:


result: