QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#90524 | #5254. Differences | SolitaryDream# | WA | 41ms | 61760kb | C++20 | 1.2kb | 2023-03-23 14:33:37 | 2023-03-23 14:33:38 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+1e3+7,L=25;
int n,m,k;
int cnt[L+1][N][4],all[N];
bool cho[L+1][N];
string s[N];
mt19937_64 rng(58);
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cin>>n>>m>>k;
for(int i=1;i<=n;i++)
cin>>s[i],s[i]=' '+s[i];
for(int i=1;i<=L;i++)
{
int b=64;
unsigned long long w=-1;
for(int j=1;j<=n;j++)
{
if(b==64)
w=rng(),b=0;
b--;
cho[i][j]=w&1;
// printf("%d%c",cho[i][j]," \n"[j==n]);
w>>=1;
}
}
for(int i=1;i<=L;i++)
for(int j=1;j<=n;j++)
if(cho[i][j])
for(int k=1;k<=m;k++)
cnt[i][k][s[j][k]-'A']++,all[i]++;
for(int i=1;i<=n;i++)
{
bool ok=1;
for(int j=1;j<=L;j++)
{
int S=all[j];
for(int k=1;k<=m;k++)
S-=cnt[j][k][s[i][k]-'A'];
int R=(all[j]-cho[j][i]*m)/m*k;
if(S!=R)
{
ok=0;
break;
}
}
if(!ok)
continue;
cout<<i<<endl;
return 0;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 41ms
memory: 61760kb
input:
3585 4096 2048 ABBBBBBAABAAAAAAAAAAAAABAABABBBABABAAAAABABAAAABAABAABBABBAABAABABBABAABBABBABABABBAAAABBABAABBBBABBBAABBBBBABAABAAABAAABBBBAAAABAABAABABABABBBBBABAAABAAABBAABABBABAABBAABBAABABBBBAABAAAABAABBABAAABBAAAAAABAABBABBABAABABBBAABABBABABBBAAAAABBBABABABBAABAAAABBBBABABAABBBABABABBAABBBABAB...
output:
1
result:
wrong answer 1st lines differ - expected: '1397', found: '1'