Submission #777937

#TimeUsernameProblemLanguageResultExecution timeMemory
777937TheSahibGenetics (BOI18_genetics)C++14
46 / 100
2045 ms12848 KiB
#pragma GCC optimize("O3") #pragma GCC target("popcnt") #include <bits/stdc++.h> #define ll long long #define oo 1e9 #define pii pair<int, int> using namespace std; const int MAX = 4100; int n, m, k; bitset<MAX * 4> st[MAX]; int ans[MAX]; void solve(){ 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(); if(c == 'G') c = 'B'; if(c == 'T') c = 'D'; st[i][(c - 'A') * MAX + j] = 1; } } vector<int> v; v.resize(n); iota(v.begin(), v.end(), 0); srand(time(0)); random_shuffle(v.begin(), v.end()); for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if(m - (st[v[i]] & st[v[j]]).count() == k){ ans[v[i]]++; ans[v[j]]++; } } if(ans[v[i]] == n - 1){ cout << v[i] + 1 << '\n'; return; } } } int main() { solve(); }

Compilation message (stderr)

genetics.cpp: In function 'void solve()':
genetics.cpp:44:50: warning: comparison of integer expressions of different signedness: 'std::size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   44 |             if(m - (st[v[i]] & st[v[j]]).count() == k){
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
genetics.cpp:21:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |     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...