BestCoder Round #65 hdu5590(水题)
ZYB's Biology
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 713 Accepted Submission(s): 522
he gives you a DNA sequence and a RNA sequence,then he asks you whether the DNA sequence and the RNA sequence are
matched.
The DNA sequence is a string consisted of A,C,G,T;The RNA sequence is a string consisted of A,C,G,U.
DNA sequence and RNA sequence are matched if and only if A matches U,T matches A,C matches G,G matches C on each position.
For each teatcase:
In the first line there is one number N.
In the next line there is a string of length N,describe the DNA sequence.
In the third line there is a string of length N,describe the RNA sequence.
1≤T≤10,1≤N≤100
UGCA
ACGU
#include<stdio.h>
#include<string.h>
#include<string>
#include<math.h>
#include<algorithm>
#define LL long long
#define PI atan(1.0)*4
#define DD double
#define MAX 110
#define mod 10007
#define dian 1.000000011
char s1[MAX],s2[MAX];
using namespace std;
int judge(int x)
{
int flag=0;
if(s1[x]=='A'&&s2[x]=='U')
flag=1;
else if(s1[x]=='C'&&s2[x]=='G')
flag=1;
else if(s1[x]=='G'&&s2[x]=='C')
flag=1;
else if(s1[x]=='T'&&s2[x]=='A')
flag=1;
if(flag) return 1;
else return 0;
}
int main()
{
int t,n,m,i,j;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
scanf("%s",s1);
scanf("%s",s2);
int flag=1;
for(i=0;i<n;i++)
{
if(!judge(i))
{
flag=0;
break;
}
}
if(flag) printf("YES\n");
else printf("NO\n");
}
return 0;
}
BestCoder Round #65 hdu5590(水题)的更多相关文章
- hdu 5284 BestCoder Round #48 ($) 1001 水题 *
题意:看一个字符串中是否包含顺序的 w y h ,字符之间可以有其他字符,并且如果有多个连续的vv,则可以看做一个w 比较水,直接看代码 #include<cstdio> #incl ...
- HDU5804 Price List (BestCoder Round #86 A)水题
分析:大于总和输出1 #include <cstdio> #include <cstring> #include <algorithm> using namespa ...
- 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 ...
- bestcoder Round #7 前三题题解
BestCoder Round #7 Start Time : 2014-08-31 19:00:00 End Time : 2014-08-31 21:00:00Contest Type : ...
- BestCoder Round #86 二,三题题解(尺取法)
第一题太水,跳过了. NanoApe Loves Sequence题目描述:退役狗 NanoApe 滚回去学文化课啦! 在数学课上,NanoApe 心痒痒又玩起了数列.他在纸上随便写了一个长度为 nn ...
- BestCoder Round #85 前三题题解
sum Accepts: 822 Submissions: 1744 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/13107 ...
- BestCoder Round #65 hdu5591(尼姆博弈)
ZYB's Game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total ...
- BestCoder Round #65 (ZYB's Biology)
ZYB's Biology Accepts: 848 Submissions: 1199 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 13 ...
随机推荐
- tomcat web.xml配置
关于Tomcat 中 web.xml 文件的配置问题: 1.下面的配置是合法的 <servlet> <servlet-name>test</serv ...
- 函数buf_page_init_for_read
/********************************************************************//** Function which inits a pag ...
- SharePoint的安装配置
安装环境 1. Window server 2008 r2(sp2) OS.2. MS SQL Server 2008 r2.3. Office2010.4. IIS7以上.5. 确认服务器已经加入域 ...
- Selenium Tutorial (2) - Selenium IDE In Depth
Installing Firefox and Firebug Installing and Opening Selenium IDE Starting with test cases and test ...
- phpDoc 注释案例说明
<?php /** * start page for webaccess * * PHP version 5 * * @category PHP * @package PSI_Web * @au ...
- BOM浏览器对象模型和API速查
什么是BOMBOM是Browser Object Model的缩写,简称浏览器对象模型BOM提供了独立于内容而与浏览器窗口进行交互的对象由于BOM主要用于管理窗口与窗口之间的通讯,因此其核心对象是wi ...
- Android自定义的webView——可实现的网页文本的复制
package com.example.customlinearlayout.view; import android.app.ProgressDialog; import android.conte ...
- 【转】cocos2d-x与ios内存管理分析(在游戏中减少内存压力)
猴子原创,欢迎转载.转载请注明: 转载自Cocos2D开发网–Cocos2Dev.com,谢谢! 原文地址: http://www.cocos2dev.com/?p=281 注:自己以前也写过coco ...
- SQL对Xml字段的操作
转:http://www.cnblogs.com/youring2/archive/2008/11/27/1342288.html T-Sql操作Xml数据 一.前言 SQL Server 2005 ...
- Android开源项目SlidingMenu深切解析
demo:http://download.csdn.net/detail/javadxz/6954819 SlidingMenu的是一种斗劲新的设置界面或设备界面结果,在主界面左滑或者右滑呈现设置界面 ...