hdoj 5590 ZYB's Biology 【水题】
来源:互联网 发布:sql server 2008下载 编辑:程序博客网 时间:2024/06/05 07:02
ZYB's Biology
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 9 Accepted Submission(s): 8
Problem Description
After getting 600 scores in NOIP ZYB(ZJ−267) begins to work with biological questions.Now he give you a simple biological questions:
he gives you aDNA sequence and a RNA sequence,then he asks you whether the DNA sequence and the RNA sequence are
matched.
TheDNA 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.
he gives you a
matched.
The
Input
In the first line there is the testcase T .
For each teatcase:
In the first line there is one numberN .
In the next line there is a string of lengthN ,describe the DNA sequence.
In the third line there is a string of lengthN ,describe the RNA sequence.
1≤T≤10 ,1≤N≤100
For each teatcase:
In the first line there is one number
In the next line there is a string of length
In the third line there is a string of length
Output
For each testcase,print YES or NO ,describe whether the two arrays are matched.
Sample Input
24ACGTUGCA4ACGTACGU
Sample Output
YESNO
水题,直接模拟。
AC代码:
#include <cstdio>#include <cstring>#include <cmath>#include <cstdlib>#include <algorithm>#include <queue>#include <stack>#include <map>#include <set>#include <vector>#define INF 0x3f3f3f#define eps 1e-8#define MAXN (100+10)#define MAXM (100000)#define Ri(a) scanf("%d", &a)#define Rl(a) scanf("%lld", &a)#define Rf(a) scanf("%lf", &a)#define Rs(a) scanf("%s", a)#define Pi(a) printf("%d\n", (a))#define Pf(a) printf("%.2lf\n", (a))#define Pl(a) printf("%lld\n", (a))#define Ps(a) printf("%s\n", (a))#define W(a) while(a--)#define CLR(a, b) memset(a, (b), sizeof(a))#define MOD 1000000007#define LL long long#define lson o<<1, l, mid#define rson o<<1|1, mid+1, r#define ll o<<1#define rr o<<1|1using namespace std;bool judge(char a, char b){ if(a == 'A' && b == 'U') return true; if(a == 'T' && b == 'A') return true; if(a == 'C' && b == 'G') return true; if(a == 'G' && b == 'C') return true; return false;}int main(){ int t; Ri(t); W(t) { int n; char a[110], b[110]; Ri(n); Rs(a); Rs(b); bool flag = true; for(int i = 0; i < n; i++) { if(!judge(a[i], b[i])) { flag = false; break; } } printf(flag ? "YES\n" : "NO\n"); } return 0;}
0 0
- hdoj 5590 ZYB's Biology 【水题】
- HDOJ 5590 ZYB's Biology
- HDOJ 5590 ZYB's Biology
- hdoj-5590-ZYB's Biology
- 【水】HDOJ ZYB's Biology 5590
- hdoj 5592 ZYB's Biology 【线段树】 hdoj 5590 ZYB's Biology 【字符串水题】
- hdoj ZYB's Biology 5590 (字符串) 水
- HDU 5590 ZYB's Biology
- HDU 5590 ZYB's Biology
- 杭电5590 ZYB's Biology
- hdu 5590 ZYB's Biology(水)
- ZYB's Biology
- ZYB's Biology解题报告
- BestCoder Round #65 ZYB's Biology
- hdoj 5591 ZYB's Game 【水题】
- 【BestCoder Round 65A】【水题】ZYB's Biology DNA与RNA是否匹配
- BestCoder Round #65 1001 ZYB's Biology HDU5590
- HDOJ 5591 ZYB's Game
- VI常用命令
- 【CUDA】第一个CUDA程序-addVector
- SpringMVC 通过XML方式进行配置解析BeanNameUrlHandlerMapping
- Machine Learning week 10 quiz: Large Scale Machine Learning
- C++:词法分析
- hdoj 5590 ZYB's Biology 【水题】
- MySQL my.cnf 中文参考
- P1057 盖房子
- [简单实用系列] 说明
- JavaFX入门(五):使用CSS样式美化你的UI控件
- fedora 安装中文输入法
- js下载文件以及下载文件名乱码问题的解决
- android5.0自带兼容控件__Toolbar
- hdoj 5591 ZYB's Game 【水题】