This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
long long litery[30][6000];
long long los[6000];
string t[6000];
int main()
{
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
srand(time(0));
long long n,m,k;
cin>>n>>m>>k;
long long suma_ogolna=0;
for(int i=1;i<=n;i++)
{
los[i]=rand()%1000000000;
suma_ogolna+=los[i];
}
for(int i=1;i<=n;i++)
{
cin>>t[i];
for(int j=0;j<m;j++)
litery[t[i][j]-'A'][j]+=los[i];
}
for(int i=1;i<=n;i++)
{
long long suma=0;
for(int j=0;j<m;j++)
suma+=litery[t[i][j]-'A'][j]-los[i];
if((suma_ogolna-los[i])*(m-k)==suma)
{
cout<<i;
return 0;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |