QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#293988#5254. DifferencesLaStataleBlue#WA 19ms20580kbC++23896b2023-12-30 01:37:492023-12-30 01:37:49

Judging History

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

  • [2023-12-30 01:37:49]
  • 评测
  • 测评结果:WA
  • 用时:19ms
  • 内存:20580kb
  • [2023-12-30 01:37:49]
  • 提交

answer

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

mt19937 rng((uint64_t) chrono::duration_cast<chrono::
    nanoseconds>(chrono::high_resolution_clock::now()
        .time_since_epoch()).count());

void solve(int t){
    int n,m,k;
    cin>>n>>m>>k;
    
    vector<string> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    
    vector num(m,vector(4,0));
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            num[j][v[i][j]-'A']++;
        }
    }
    
    for(int i=0;i<n;i++){
        int sum=0;
        for(int j=0;j<m;j++){
            sum+=n-num[j][v[i][j]-'A'];
        }
        
        if(sum==(n-1)*k){
            cout<<i+1<<"\n";
            return;
        }
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int t=1;
    //cin>>t;
    for(int i=1;i<=t;i++)solve(i);
    
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 19ms
memory: 20580kb

input:

3585 4096 2048
ABBBBBBAABAAAAAAAAAAAAABAABABBBABABAAAAABABAAAABAABAABBABBAABAABABBABAABBABBABABABBAAAABBABAABBBBABBBAABBBBBABAABAAABAAABBBBAAAABAABAABABABABBBBBABAAABAAABBAABABBABAABBAABBAABABBBBAABAAAABAABBABAAABBAAAAAABAABBABBABAABABBBAABABBABABBBAAAAABBBABABABBAABAAAABBBBABABAABBBABABABBAABBBABAB...

output:

2

result:

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