제출 #640980

#제출 시각아이디문제언어결과실행 시간메모리
640980SheikhPhGenetics (BOI18_genetics)C++17
0 / 100
98 ms6984 KiB
#include <bits/stdc++.h> using namespace std; vector<int> w; int main() { int n, m, k; cin >> n >> m >> k; vector<vector<int>> miss(m, vector<int>(4, 0)); auto trans = [](char c){ string str = "ACTG"; for(int j =0; j < 4; j++) { if(str[j] == c) return j; } assert(false); }; w = vector<int>(n); int sum = 0; for(int i =0; i <n; i++) { w[i] = rand() % 137; sum+= w[i]; } vector<string> lin(n); for(int i =0; i < n; i++) { cin >> lin[i]; } for(int i = 0; i < m; i++) { for(int j= 0; j < n; j++) { miss[i][trans(lin[j][i])] += w[j]; } } for(int i =0; i < n; i ++) { bool flag = true; int ans = 0; for(int j= 0; j < m; j++) { for(int ii =0; ii < 4; ii ++) { if("ACTG"[ii] != lin[i][j]) ans += miss[j][ii]; } } if(ans == k* (sum - w[i])) { cout << i +1; return 0; } } assert(false); return 0; }

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

genetics.cpp: In function 'int main()':
genetics.cpp:53:14: warning: unused variable 'flag' [-Wunused-variable]
   53 |         bool flag = 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...