BestCoder Round #65 (ZYB's Biology)

ZYB's Biology

Accepts: 848
Submissions: 1199
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 131072/131072 K (Java/Others)
Problem Description

After getting 600600600 scores in NOIPNOIPNOIP ZYB(ZJ−267)ZYB(ZJ-267)ZYB(ZJ267) begins to work with biological questions.Now he give you a simple biological questions: he gives you a DNADNADNA sequence and a RNARNARNA sequence,then he asks you whether the DNADNADNA sequence and the RNARNARNA sequence are matched.

The DNADNADNA sequence is a string consisted of A,C,G,TA,C,G,TA,C,G,T;The RNARNARNA sequence is a string consisted of A,C,G,UA,C,G,UA,C,G,U.

DNADNADNA sequence and RNARNARNA sequence are matched if and only if AAA matches UUU,TTT matches AAA,CCC matches GGG,GGG matches CCC on each position.

Input

In the first line there is the testcase TTT.

For each teatcase:

In the first line there is one number NNN.

In the next line there is a string of length NNN,describe the DNADNADNA sequence.

In the third line there is a string of length NNN,describe the RNARNARNA sequence.

1≤T≤101 \leq T \leq 101T10,1≤N≤1001 \leq N \leq 1001N100

Output

For each testcase,print YESYESYES or NONONO,describe whether the two arrays are matched.

Sample Input
2
4
ACGT
UGCA
4
ACGT
ACGU
Sample Output
YES
NO

巨水的题目:但是却WA了两次!!!!!靠;就是那行freopen;忘了打杠了!!!!!
#include <iostream>
#include <cstdio>
#include<cstring>
using namespace std;
int t,n,x;
char d[105],r[105];
int main(){
    //freopen("in.txt","r",stdin);
    cin>>t;
    for(int i=0;i<t;i++){
        cin>>n;
        scanf("%s",d);
        scanf("%s",r);
        x=0;
        for(int j=0;j<n;j++){
            if((d[j]=='A'&&r[j]=='U')||(d[j]=='T'&&r[j]=='A')||(d[j]=='C'&&r[j]=='G')||(d[j]=='G'&&r[j]=='C'))
               x++;
        }
         if(x!=n)
                cout<<"NO"<<endl;
            else
                cout<<"YES"<<endl;
    }
    return 0;
}

 

转载于:https://www.cnblogs.com/yoyo-sincerely/p/5022393.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值