QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#507204#5254. Differencesthangthang#WA 22ms23424kbC++20658b2024-08-06 13:31:522024-08-06 13:31:53

Judging History

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

  • [2024-08-06 13:31:53]
  • 评测
  • 测评结果:WA
  • 用时:22ms
  • 内存:23424kb
  • [2024-08-06 13:31:52]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 5;

int n, m, k, cnt[N][4];
string s[N];

void solve(){
    cin >> n >> m >> k;
    for (int i = 1; i <= n; ++ i){
        cin >> s[i];
        for (int j = 0; j < m; ++ j) cnt[j][s[i][j] - 'A'] ++;
    }

    for (int i = 1; i <= n; ++ i){
        long long dist = 0;
        for (int j = 0; j < m; ++ j) dist += (n - cnt[j][s[i][j] - 'A']);
        if (dist == 1ll * k * (n - 1)){
            cout << i;
            return;
        }
    }
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    solve();

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 22ms
memory: 23424kb

input:

3585 4096 2048
ABBBBBBAABAAAAAAAAAAAAABAABABBBABABAAAAABABAAAABAABAABBABBAABAABABBABAABBABBABABABBAAAABBABAABBBBABBBAABBBBBABAABAAABAAABBBBAAAABAABAABABABABBBBBABAAABAAABBAABABBABAABBAABBAABABBBBAABAAAABAABBABAAABBAAAAAABAABBABBABAABABBBAABABBABABBBAAAAABBBABABABBAABAAAABBBBABABAABBBABABABBAABBBABAB...

output:

2

result:

wrong answer 1st lines differ - expected: '1397', found: '2'