BestCoder Round #65 (ZYB's Biology)
ZYB's Biology
After getting 600600600 scores in NOIPNOIPNOIP ZYB(ZJ−267)ZYB(ZJ-267)ZYB(ZJ−267) 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.
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 101≤T≤10,1≤N≤1001 \leq N \leq 1001≤N≤100
For each testcase,print YESYESYES or NONONO,describe whether the two arrays are matched.
2
4
ACGT
UGCA
4
ACGT
ACGU
YES
NO 巨水的题目:但是却WA了两次!!!!!靠;就是那行freopen;忘了打杠了!!!!!
#include <iostream>
#include <cstdio>
#include<cstring>
using namespace std;
int t,n,x;
char d[],r[];
int main(){
//freopen("in.txt","r",stdin);
cin>>t;
for(int i=;i<t;i++){
cin>>n;
scanf("%s",d);
scanf("%s",r);
x=;
for(int j=;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 ;
}
BestCoder Round #65 (ZYB's Biology)的更多相关文章
- BestCoder Round #65 (ZYB's Game)
		ZYB's Game Accepts: 672 Submissions: 1207 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536 ... 
- BestCoder Round #65 (ZYB's Premutation)
		ZYB's Premutation Accepts: 220 Submissions: 983 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: ... 
- hdu 5592 BestCoder Round #65(树状数组)
		题意: ZYB有一个排列PP,但他只记得PP中每个前缀区间的逆序对数,现在他要求你还原这个排列. (i,j)(i < j)(i,j)(i<j)被称为一对逆序对当且仅当A_i>A_jA ... 
- hdu 5591 BestCoder Round #65(博弈)
		题意: 问题描述 ZYBZYB在远足中,和同学们玩了一个“数字炸弹”游戏:由主持人心里想一个在[1,N][1,N]中的数字XX,然后玩家们轮流猜一个数字,如果一个玩家恰好猜中XX则算负,否则主持人将告 ... 
- BestCoder Round #85(ZOJ1569尚未验证)
		A题 子序列和啊,就要想到前缀和的差.这个转换一定要!记着!那么i到j的一段子序列和Sij%m == 0就等价于(Sj-Si-1)%m == 0 了,那么什么意思呢?就是如果有两段前缀和%m的模是一 ... 
- BestCoder Round #65 HDOJ5592 ZYB's Premutation(树状数组+二分)
		ZYB's Premutation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Othe ... 
- Bestcoder round #65 && hdu 5593 ZYB's Tree 树形dp
		Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submissio ... 
- Bestcoder round #65 && hdu 5592 ZYB's Premutation 线段树
		Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submissio ... 
- hdu 4956 Poor Hanamichi BestCoder Round #5(数学题)
		题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4956 Poor Hanamichi Time Limit: 2000/1000 MS (Java/Ot ... 
随机推荐
- 【BZOJ】1529 [POI2005]ska Piggy banks
			[算法](强连通分量)并查集 [题解] 1.用tarjan计算强连通分量并缩点,在新图中找入度为0的点的个数就是答案. 但是,会爆内存(题目内存限制64MB). 2.用并查集,最后从1到n统计fa[i ... 
- setTimeOut和闭包
			掘金上看到一个setTimeout与循环闭包的思考题.拿过来看了下,一方面了解settimeout的运行机制,还有就是js闭包的特性.关于闭包,有如下解释: 在这里写一点我对闭包的理解.理解闭包的关键 ... 
- Java 将html导出word格式
			@RequestMapping("download") public void exportWord( HttpServletRequest request, HttpServle ... 
- x64dbg
			https://x64dbg.com/ https://github.com/x64dbg/x64dbg https://sourceforge.net/projects/x64dbg/files/s ... 
- MVC使用Newtonsoft无需实体类,实现JSON数据返回给前端页面使用
			//引用using Newtonsoft.Json; using Newtonsoft.Json.Linq; public ActionResult JsonSample() { ResponseRe ... 
- Oracle 合并 merger into
			merge into copy_emp1 c using employees e on (c.employee_id=e.employee_id)when matched then update ... 
- spring restTemplate 用法
			发出get请求,方式一 String url = serverUrl+"/path/path?id={id}"; int i = restTemplate.getForObject ... 
- Jmeter性能测试示例
			这次成功做了一个jmeter借口性能测试的简单测试示例,分享一下给大家. jmeter作为一个简单的开源工具,基于java的性能测试工具,使用起来很简单. 也可以作为二次开发,复杂的情形可以自己写代码 ... 
- 关于HTML,css3自适应屏幕,自适应宽度
			设置了在不同分辨率下,显示的css样式: @media screen and (min-width:1080px){ .box{ width: 1080px;}.content{width: 1040 ... 
- Nginx惊群处理
			惊群:是指在多线程/多进程中,当有一个客户端发生链接请求时,多线程/多进程都被唤醒,然后只仅仅有一个进程/线程处理成功,其他进程/线程还是回到睡眠状态,这种现象就是惊群. 惊群是经常发生现在serve ... 
