제출 #501260

#제출 시각아이디문제언어결과실행 시간메모리
501260RGBBGenetics (BOI18_genetics)C++14
46 / 100
2041 ms60828 KiB
#include <iostream> #include <bits/stdc++.h> #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") using namespace std; const int MAX=4100; int n,m,k; bool flag[MAX],check[MAX][MAX]; bitset<MAX>col[MAX][4]; bitset<MAX>temp; int cnt; vector<int>ind; string inp[MAX]; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cin>>n>>m>>k; k*=2; ind=vector<int>(n); for(int i=0;i<n;i++){ cin>>inp[i]; ind[i]=i; } random_shuffle(ind.begin(),ind.end()); for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(inp[ind[i]][j]=='A')col[i][0][j]=1; else if(inp[ind[i]][j]=='C')col[i][1][j]=1; else if(inp[ind[i]][j]=='G')col[i][2][j]=1; else col[i][3][j]=1; } } for(int i=0;i<n;i++){ if(flag[i])continue; bool villain=true; for(int j=0;j<n;j++){ if(j==i)continue; if(check[i][j])continue; check[j][i]=true; cnt=0; cnt+=(col[i][0]^col[j][0]).count(); cnt+=(col[i][1]^col[j][1]).count(); cnt+=(col[i][2]^col[j][2]).count(); cnt+=(col[i][3]^col[j][3]).count(); if(cnt!=k){ villain=false; flag[j]=true; break; } } if(villain){ cout<<ind[i]+1<<"\n"; return 0; } } }

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

genetics.cpp:4: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    4 | #pragma GCC optimization ("O3")
      | 
genetics.cpp:5: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    5 | #pragma GCC optimization ("unroll-loops")
      |
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...