Submission #1095249

#TimeUsernameProblemLanguageResultExecution timeMemory
1095249vjudge1Genetics (BOI18_genetics)C++17
100 / 100
329 ms36436 KiB
#include<bits/stdc++.h> using namespace std; #define task "a" #define se second #define fi first #define ll long long #define ii pair<ll, ll> const long mxN = 4100 + 7; string s[mxN]; char chr[5] = {'A', 'T', 'G', 'C'}; int n, m; ll sum[mxN][5], k; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); //freopen(task".INP", "r", stdin); //freopen(task".OUT", "w", stdout); cin >> n >> m >> k; ll ss = 0; for (ll i = 1; i <= n; i++) { cin >> s[i]; for (int j = 0; j < m; j++) { for (int u = 0; u < 4; u++) { if (s[i][j] == chr[u]) sum[j][u] += i * i; } } ss += i * i * k; } for (ll i = 1; i <= n; i++) { ll val = 0; for (int j = 0; j < m; j++) { for (int u = 0; u < 4; u++) { if (s[i][j] != chr[u]) val += sum[j][u]; } } if (val == ss - (i * i * k)) { cout << i; return 0; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...