Advertisement
wrench786

Bovine Genomics

Feb 4th, 2022
898
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.11 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int check[5][3];
  5.  
  6. void solve(){
  7.     int n,m;
  8.     cin>>n>>m;
  9.     vector<string>arr(n*2);
  10.  
  11.     for(int i=0;i<n*2;i++){
  12.         cin>>arr[i];
  13.     }
  14.  
  15.     int ans=0;
  16.  
  17.     for(int i=0;i<m;i++){
  18.         for(int j=0;j<n;j++){
  19.             if(arr[j][i]=='A') check[1][1]=1;
  20.             if(arr[j][i]=='C') check[2][1]=1;
  21.             if(arr[j][i]=='G') check[3][1]=1;
  22.             if(arr[j][i]=='T') check[4][1]=1;
  23.         }
  24.         for(int j=n;j<n*2;j++){
  25.             if(arr[j][i]=='A') check[1][2]=1;
  26.             if(arr[j][i]=='C') check[2][2]=1;
  27.             if(arr[j][i]=='G') check[3][2]=1;
  28.             if(arr[j][i]=='T') check[4][2]=1;
  29.         }
  30.         int co=0;
  31.         for(int j=1;j<=4;j++){
  32.             if(check[j][1] && check[j][2]) co++;
  33.  
  34.             check[j][1]=0;
  35.             check[j][2]=0;
  36.         }
  37.         if(!co) ans++;
  38.     }
  39.     cout<<ans<<endl;
  40. }
  41.        
  42.  
  43. int main()
  44. {
  45.     freopen("cownomics.in", "r", stdin);
  46.     freopen("cownomics.out", "w", stdout);
  47.     int tc=1;
  48.     //scanf("%d",&tc);
  49.  
  50.     while(tc--){
  51.         solve();
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement