Submission #532611

#TimeUsernameProblemLanguageResultExecution timeMemory
532611sidonGenetics (BOI18_genetics)C++17
46 / 100
2031 ms93884 KiB
#pragma GCC optimize("O3", "unroll-loops") #pragma GCC target("avx2", "popcnt") #include <bits/stdc++.h> using namespace std; const int Z = 4100; int N, M, K; bitset<Z*4> a[Z]; int g[100]; bool chk[Z][Z]; int cnt[Z][Z]; int main() { ios::sync_with_stdio(0), cin.tie(0); g['C'] = 1; g['G'] = 2; g['T'] = 3; cin >> N >> M >> K; for(int i = 0; i < N; ++i) { string inp; cin >> inp; for(int j = 0; j < M; ++j) a[i][g[inp[j]] * Z + j] = 1; } int o[N]; iota(o, o + N, 0); stable_partition(o, o + N, [](const int &i) { return ((i ^ 1024) > N / 2); }); for(int &i : o) { bool ok = 1; a[i].flip(); for(int j = 0; j < N; ++j) if(i != j) { int c = (chk[i][j] ? cnt[i][j] : (a[i] & a[j]).count()); chk[i][j] = chk[j][i] = 1; cnt[i][j] = cnt[j][i] = c; if(c != K) { ok = 0; break; } } if(ok) { cout << i + 1; return 0; } a[i].flip(); } }

Compilation message (stderr)

genetics.cpp: In function 'int main()':
genetics.cpp:27:17: warning: array subscript has type 'char' [-Wchar-subscripts]
   27 |    a[i][g[inp[j]] * Z + j] = 1;
      |                 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...