이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
const int N = 4100 + 10;
int n, m, k, cnt[N], diff[N][N];
char c[] = {'A', 'C', 'G', 'T'};
string s[N];
bitset<N> a[N];
int main() {
ios:: sync_with_stdio(0), cin.tie(0);
cin >> n >> m >> k;
for (int i = 0; i < n; i++) cin >> s[i];
for (int k = 0; k < 4; k++) {
for (int i = 0; i < n; i++) {
a[i].reset();
for (int j = 0; j < m; j++)
if (s[i][j] == c[k]) a[i][j] = 1;
}
for (int i = 0; i < n; i++)
for (int j = i + 1; j < n; j++)
if (diff[i][j] <= 2 * k) diff[i][j] += (a[i] ^ a[j]).count();
}
for (int i = 0; i < n; i++)
for (int j = i + 1; j < n; j++)
if (diff[i][j] == 2 * k) cnt[i]++, cnt[j]++;
for (int i = 0; i < n; i++)
if (cnt[i] == n - 1) {
cout << i + 1 << '\n';
break;
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
genetics.cpp: In function 'int main()':
genetics.cpp:30:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
30 | for (int i = 0; i < n; i++)
| ^~~
genetics.cpp:35:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
35 | return 0;
| ^~~~~~| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |