Submission #961292

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9612922024-04-11 19:45:34mgchGenetics (BOI18_genetics)C++14
27 / 100
2029 ms12124 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 4107, L = 26, K = 66, MOD = 1000000007;
char s[N][N];
int main() {
// freopen("input.txt", "r", stdin);
// ios::sync_with_stdio(false); cin.tie(0);
int n, m, k;
scanf("%d%d%d\n", &n, &m, &k);
vector <int> ord(n), rnk(n, 0);
iota(ord.begin(), ord.end(), 0);
for (int i = 0; i < n; ++i) {
scanf("%s\n", s[i]);
}
auto diff = [&](int x, int y) {
int ans = 0;
for (int i = 0; i < m; ++i) {
ans += s[x][i] != s[y][i];
}
return ans;
};
for (int it = 0; it < K; ++it) {
for (int i = 0; i + 1 < (int)ord.size(); ++i) {
if (diff(ord[i], ord[i + 1]) != k) {
++i;
continue;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

genetics.cpp: In function 'int main()':
genetics.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |     scanf("%d%d%d\n", &n, &m, &k);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
genetics.cpp:17:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |         scanf("%s\n", s[i]);
      |         ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...