Submission #473324

#TimeUsernameProblemLanguageResultExecution timeMemory
473324Hamed5001Genetics (BOI18_genetics)C++14
27 / 100
2082 ms5588 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int check(string& _1, string& _2) { int ret = 0; for (int i = 0; i < _1.size(); i++) ret += (_1[i] != _2[i]); return ret; } void solve() { int N, M, K; cin >> N >> M >> K; vector<string> DNA(N); for (auto& dna : DNA) cin >> dna; for (int i = 0; i < N; i++) { bool found = 1; for (int j = 0; j < N && found; j++) { if (i == j) continue; found &= (check(DNA[i], DNA[j]) == K); } if (found) return void(cout << i+1); } } int main() { ios_base::sync_with_stdio(false); cin.tie(0); solve(); }

Compilation message (stderr)

genetics.cpp: In function 'int check(std::string&, std::string&)':
genetics.cpp:8:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |  for (int i = 0; i < _1.size(); 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...