标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 560 Accepted Submission(s): 413
#include<iostream> #include<cstdio> using namespace std; int main() { int N,length,a[100],b[100],i,j,k; char temp; cin>>N; while(N--) { cin>>length; for(i=0;i<length;i++) { cin>>temp; if(temp==‘A‘) a[i]=1; else if(temp==‘C‘)a[i]=2; else if(temp==‘G‘)a[i]=3; else if(temp==‘T‘)a[i]=4; } for(j=0;j<length;j++) { cin>>temp; if(temp==‘U‘) b[j]=1; else if(temp==‘G‘)b[j]=2; else if(temp==‘C‘)b[j]=3; else if(temp==‘A‘)b[j]=4; } for(k=0;k<length;k++) { if(a[k]!=b[k]) break; } if(k<length) cout<<"NO"<<endl; else if(k==length) cout<<"YES"<<endl; } return 0; }
标签:
原文地址:http://www.cnblogs.com/tt-t/p/5070990.html