제출 #878302

#제출 시각아이디문제언어결과실행 시간메모리
878302vjudge1Genetics (BOI18_genetics)C++17
46 / 100
969 ms83240 KiB
#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<3 * 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] = a[i][4 * j + 1] = 1; else if (s[i][j] == 'C') a[i][4 * j] = a[i][4 * j + 2] = 1; else if (s[i][j] == 'T') a[i][4 * j + 1] = a[i][4 * j + 2] = 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:38:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   38 |     for (int i = 0; i < n; i++)
      |     ^~~
genetics.cpp:43:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   43 |  return 0;
      |  ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...