QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#536397#5254. DifferenceschimeraWA 252ms30292kbC++11687b2024-08-29 10:33:252024-08-29 10:33:25

Judging History

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

  • [2024-08-29 10:33:25]
  • 评测
  • 测评结果:WA
  • 用时:252ms
  • 内存:30292kb
  • [2024-08-29 10:33:25]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

ll calc(string& A, string& B) {
    ll ans = 0;
    for(ll i = 0; i < A.size(); i++) ans += (A[i]!=B[i]);
    return ans;
}

int main() {
    ll N,M,K; cin >> N >> M >> K;

    vector<string> Ss(N);
    for(ll i = 0; i < N; i++) cin >> Ss[i];

    ll ans;
    for(ll i = 0; i < N; i++) {
        ll ct = 0;
        ll tr = 0;
        for(ll j = 0; j < 10; j++) {
            ll i2 = (i+1+j)%N;
            if(i2 != i) {
                tr++;
                if(calc(Ss[i],Ss[i2]) == K) ct++;
            }
        }

        if(tr == ct) ans = i+1;
    }

    cout << ans << endl;


}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 252ms
memory: 30292kb

input:

3585 4096 2048
ABBBBBBAABAAAAAAAAAAAAABAABABBBABABAAAAABABAAAABAABAABBABBAABAABABBABAABBABBABABABBAAAABBABAABBBBABBBAABBBBBABAABAAABAAABBBBAAAABAABAABABABABBBBBABAAABAAABBAABABBABAABBAABBAABABBBBAABAAAABAABBABAAABBAAAAAABAABBABBABAABABBBAABABBABABBBAAAAABBBABABABBAABAAAABBBBABABAABBBABABABBAABBBABAB...

output:

3585

result:

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