//AVEC LE TUTO
#include <bits/stdc++.h>
#define int long long
#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using namespace std;
signed main() {
ios_base::sync_with_stdio(false); cin.tie(nullptr);
int n,m,k; cin >> n >> m >> k;
vector<vector<int>> d(4,vector<int>(m));
vector<int> r(n);
vector<vector<int>> a(n,vector<int>(m,0));
for (int i = 0; i < n; i++) r[i]=rand();
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
char hc; cin >> hc;
if(hc=='C') {
a[i][j]=1;
}else if(hc=='G') {
a[i][j]=2;
}else if(hc=='T') {
a[i][j]=3;
}
for (int l = 0; l < 4; l++)
{
if(l==a[i][j]) continue;
d[l][j]+=r[i];
}
}
}
for (int i = 0; i < n; i++)
{
int s=0;
for (int j = 0; j < m; j++)
{
s+=d[a[i][j]][j];
}
for (int j = 0; j < n; j++)
{
if(i==j) continue;
s-=r[j]*k;
}
if(s==0){
cout << i+1 << "\n";
break;
}
}
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... |