Submission #777776

#TimeUsernameProblemLanguageResultExecution timeMemory
777776TheSahibGenetics (BOI18_genetics)C++14
19 / 100
2008 ms2384 KiB
#include <bits/stdc++.h> #define ll long long #define oo 1e9 #define pii pair<int, int> using namespace std; bitset<4100> st[4100]; void solve(){ int n, m, k; scanf("%d%d%d", &n, &m, &k); for (int i = 0; i < n; i++) { getchar(); for (int j = 0; j < m; j++) { char c = getchar(); st[i][j] = (c == 'C'); } } vector<int> v; v.resize(n); iota(v.begin(), v.end(), 0); srand(time(0)); random_shuffle(v.begin(), v.end()); for (int i:v) { bool pos = true; for (int j:v) { if(i == j) continue; if((st[i] ^ st[j]).count() != k){ pos = false; break; } } if(pos){ cout << i + 1 << '\n'; return; } } } int main() { solve(); }

Compilation message (stderr)

genetics.cpp: In function 'void solve()':
genetics.cpp:34:40: warning: comparison of integer expressions of different signedness: 'std::size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   34 |             if((st[i] ^ st[j]).count() != k){
      |                ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
genetics.cpp:13:23: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |     int n, m, k; scanf("%d%d%d", &n, &m, &k);
      |                  ~~~~~^~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...