제출 #878136

#제출 시각아이디문제언어결과실행 시간메모리
878136vjudge1Genetics (BOI18_genetics)C++17
0 / 100
407 ms14808 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #pragma GCC optimize("Ofast,unroll-loops") #pragma GCC target("avx2") const int N = 4100 + 4; int n, m, k; bool done[N]; char s[N][N]; bitset<N> tmp, a[N], g[N], c[N], t[N]; int main() { ios::sync_with_stdio(0); cin.tie(0); bool AC = true; cin >> n >> m >> k; for (int i = 0; i < n; ++i) { cin >> s[i]; for (int j = 0; j < m; ++j) { if (s[i][j] == 'A') { a[i][j] = true; } else if (s[i][j] == 'G') { g[i][j] = true; } else if (s[i][j] == 'C') { c[i][j] = true; } else if (s[i][j] == 'T') { t[i][j] = true; } } } for (int i = 0; i < n; ++i) { if (done[i] == true) { continue; } bool ok = true; for (int j = i + 1; j < n; ++j) { int cnt = 0; tmp = a[i] & a[j]; cnt += tmp.count(); tmp = g[i] & g[j]; cnt += tmp.count(); tmp = c[i] & c[j]; cnt += tmp.count(); tmp = t[i] & t[j]; cnt += tmp.count(); // cout << i + 1 << ' ' << j + 1 << ' ' << cnt << '\n'; if (m - cnt != k) { ok = false; done[j] = true; } } if (ok == true) { cout << i + 1; return 0; } } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

genetics.cpp: In function 'int main()':
genetics.cpp:21:10: warning: unused variable 'AC' [-Wunused-variable]
   21 |     bool AC = true;
      |          ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...