Submission #593871

#TimeUsernameProblemLanguageResultExecution timeMemory
593871AlesL0Genetics (BOI18_genetics)C++17
27 / 100
2068 ms3144 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int comp(string a, string b){ int r = 0; for (int i = 0; i < a.size(); i++)if (a[i] != b[i])r++; return r; } int main(){ int n, m, k; cin >> n >> m >> k; string x[n]; for (int i = 0; i < n; i++)cin >> x[i]; for (int i = 0; i < n; i++){ bool flag10 = 1; for (int j = 0; j < n; j++){ if (i == j)continue; if (comp(x[i], x[j]) != k){ flag10 = 0; break; } } if (flag10){ cout << i+1; break; } } }

Compilation message (stderr)

genetics.cpp: In function 'int comp(std::string, std::string)':
genetics.cpp:9:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for (int i = 0; i < a.size(); i++)if (a[i] != b[i])r++;
      |                     ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...