QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#536398 | #5254. Differences | chimera | WA | 708ms | 30328kb | C++11 | 687b | 2024-08-29 10:42:01 | 2024-08-29 10:42:02 |
Judging History
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 < 60; 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;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 708ms
memory: 30328kb
input:
3585 4096 2048 ABBBBBBAABAAAAAAAAAAAAABAABABBBABABAAAAABABAAAABAABAABBABBAABAABABBABAABBABBABABABBAAAABBABAABBBBABBBAABBBBBABAABAAABAAABBBBAAAABAABAABABABABBBBBABAAABAAABBAABABBABAABBAABBAABABBBBAABAAAABAABBABAAABBAAAAAABAABBABBABAABABBBAABABBABABBBAAAAABBBABABABBAABAAAABBBBABABAABBBABABABBAABBBABAB...
output:
3585
result:
wrong answer 1st lines differ - expected: '1397', found: '3585'