이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#pragma GCC optimize(" unroll-loops")
#pragma gcc optimize("Ofast")
#pragma GCC optimization("Ofast")
#pragma optimize(Ofast)
using namespace std;
const int N = 4100 + 1;
int n, m, k, cnt[N], diff[N][N];
char c[] = {'A', 'C', 'G', 'T'};
string s[N];
bitset<4 * 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 i = 0; i < n; i++) {
a[i].reset();
for (int j = 0; j < m; j++) {
if (s[i][j] == 'A')
a[i][4 * j] = 1;
else if (s[i][j] == 'C')
a[i][4 * j + 1] = 1;
else if (s[i][j] == 'T')
a[i][4 * j + 2] = 1;
else if (s[i][j] == 'G')
a[i][4 * j + 3] = 1;
}
}
for (int i = 0; i < n; i++)
for (int j = i + 1; j < n; j++)
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:5: warning: ignoring '#pragma gcc optimize' [-Wunknown-pragmas]
5 | #pragma gcc optimize("Ofast")
|
genetics.cpp:6: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
6 | #pragma GCC optimization("Ofast")
|
genetics.cpp:7: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
7 | #pragma optimize(Ofast)
|
genetics.cpp:4:37: warning: bad option '-f unroll-loops' to pragma 'optimize' [-Wpragmas]
4 | #pragma GCC optimize(" unroll-loops")
| ^
genetics.cpp:17:10: warning: bad option '-f unroll-loops' to attribute 'optimize' [-Wattributes]
17 | int main() {
| ^
genetics.cpp: In function 'int main()':
genetics.cpp:40:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
40 | for (int i = 0; i < n; i++)
| ^~~
genetics.cpp:45:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
45 | 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... |