Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int check[5][3];
- void solve(){
- int n,m;
- cin>>n>>m;
- vector<string>arr(n*2);
- for(int i=0;i<n*2;i++){
- cin>>arr[i];
- }
- int ans=0;
- for(int i=0;i<m;i++){
- for(int j=0;j<n;j++){
- if(arr[j][i]=='A') check[1][1]=1;
- if(arr[j][i]=='C') check[2][1]=1;
- if(arr[j][i]=='G') check[3][1]=1;
- if(arr[j][i]=='T') check[4][1]=1;
- }
- for(int j=n;j<n*2;j++){
- if(arr[j][i]=='A') check[1][2]=1;
- if(arr[j][i]=='C') check[2][2]=1;
- if(arr[j][i]=='G') check[3][2]=1;
- if(arr[j][i]=='T') check[4][2]=1;
- }
- int co=0;
- for(int j=1;j<=4;j++){
- if(check[j][1] && check[j][2]) co++;
- check[j][1]=0;
- check[j][2]=0;
- }
- if(!co) ans++;
- }
- cout<<ans<<endl;
- }
- int main()
- {
- freopen("cownomics.in", "r", stdin);
- freopen("cownomics.out", "w", stdout);
- int tc=1;
- //scanf("%d",&tc);
- while(tc--){
- solve();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement