QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#269809#5254. DifferencesteafrogsfWA 77ms24288kbC++14818b2023-11-30 01:56:592023-11-30 01:57:00

Judging History

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

  • [2023-11-30 01:57:00]
  • 评测
  • 测评结果:WA
  • 用时:77ms
  • 内存:24288kb
  • [2023-11-30 01:56:59]
  • 提交

answer

#include<cstdio>
#include<iostream>
#include<string>
#define f(i,a,b) for(int i=(a),i##end=(b);i<=i##end;i=-(~i))
using namespace std;
const int neko=1e5+10;
using ll=long long;
int n,m,K;
string s[neko];
ll w[neko],sumw=0;
int cnt[neko][5];
int rd(int l,int r){return 1ll*rand()*rand()%(r-l+1)+l;}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
    srand(19260817);
    cin>>n>>m>>K;
    f(i,1,n)
    {
        cin>>s[i];
    }
    f(i,1,n)w[i]=rd(1,1e9),sumw+=w[i];
    f(i,1,n)
        f(j,1,m)
            cnt[j][s[i][j-1]-'A']+=w[i];
    f(i,1,n)
    {
        ll now=0;
        f(j,1,m)
            f(k,0,3)if(s[i][j-1]!='A'+k)now+=cnt[j][k];
        //cout<<i<<" "<<now<<endl;
        if(now==K*(sumw-w[i]))return cout<<i<<endl,0;
    }
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 77ms
memory: 24288kb

input:

3585 4096 2048
ABBBBBBAABAAAAAAAAAAAAABAABABBBABABAAAAABABAAAABAABAABBABBAABAABABBABAABBABBABABABBAAAABBABAABBBBABBBAABBBBBABAABAAABAAABBBBAAAABAABAABABABABBBBBABAAABAAABBAABABBABAABBAABBAABABBBBAABAAAABAABBABAAABBAAAAAABAABBABBABAABABBBAABABBABABBBAAAAABBBABABABBAABAAAABBBBABABAABBBABABABBAABBBABAB...

output:


result:

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