QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#129289#5254. DifferencesSommohito#WA 27ms23744kbC++201000b2023-07-22 14:05:462023-07-22 14:05:50

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-22 14:05:50]
  • 评测
  • 测评结果:WA
  • 用时:27ms
  • 内存:23744kb
  • [2023-07-22 14:05:46]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#ifdef APURBA
#include "DEBUG_TEMPLATE.h"
#else
#define HERE
#define debug(args...)
#endif
#define ALL(x) x.begin(),x.end()
const int N = 1e5 + 1;

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


int32_t main()
{
#ifndef APURBA
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#endif
    cin>>n>>m>>k;
    for(int i=0;i<n;i++)
        cin>>s[i];
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            cnt[j][s[i][j]-'A']++;
        }
    }
    for(int i=0;i<n;i++)
    {
        int tot = 0;
        for(int j=0;j<m;j++)
        {
            for(int k=0;k<4;k++)
            {
                if(s[i][j]-'A' == k)
                    continue;
                tot += cnt[j][k];
            }
        }
        if(tot == k*(n-1))
        {
            cout<<i+1<<"\n";
            return 0;
        }
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 27ms
memory: 23744kb

input:

3585 4096 2048
ABBBBBBAABAAAAAAAAAAAAABAABABBBABABAAAAABABAAAABAABAABBABBAABAABABBABAABBABBABABABBAAAABBABAABBBBABBBAABBBBBABAABAAABAAABBBBAAAABAABAABABABABBBBBABAAABAAABBAABABBABAABBAABBAABABBBBAABAAAABAABBABAAABBAAAAAABAABBABBABAABABBBAABABBABABBBAAAAABBBABABABBAABAAAABBBBABABAABBBABABABBAABBBABAB...

output:

2

result:

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