青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

隨筆 - 87  文章 - 279  trackbacks - 0
<2025年9月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

潛心看書研究!

常用鏈接

留言簿(19)

隨筆分類(81)

文章分類(89)

相冊

ACM OJ

My friends

搜索

  •  

積分與排名

  • 積分 - 219403
  • 排名 - 118

最新評論

閱讀排行榜

評論排行榜

Human Gene Functions
Time Limit:1000MS? Memory Limit:10000K
Total Submit:866 Accepted:507

Description
It is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four letters, A, C, G, and T. Biologists have been interested in identifying human genes and determining their functions, because these can be used to diagnose human diseases and to design new drugs for them.

A human gene can be identified through a series of time-consuming biological experiments, often with the help of computer programs. Once a sequence of a gene is obtained, the next job is to determine its function.
One of the methods for biologists to use in determining the function of a new gene sequence that they have just identified is to search a database with the new gene as a query. The database to be searched stores many gene sequences and their functions – many researchers have been submitting their genes and functions to the database and the database is freely accessible through the Internet.

A database search will return a list of gene sequences from the database that are similar to the query gene.
Biologists assume that sequence similarity often implies functional similarity. So, the function of the new gene might be one of the functions that the genes from the list have. To exactly determine which one is the right one another series of biological experiments will be needed.

Your job is to make a program that compares two genes and determines their similarity as explained below. Your program may be used as a part of the database search if you can provide an efficient one.
Given two genes AGTGATG and GTTAG, how similar are they? One of the methods to measure the similarity
of two genes is called alignment. In an alignment, spaces are inserted, if necessary, in appropriate positions of
the genes to make them equally long and score the resulting genes according to a scoring matrix.

For example, one space is inserted into AGTGATG to result in AGTGAT-G, and three spaces are inserted into GTTAG to result in –GT--TAG. A space is denoted by a minus sign (-). The two genes are now of equal
length. These two strings are aligned:

AGTGAT-G
-GT--TAG

In this alignment, there are four matches, namely, G in the second position, T in the third, T in the sixth, and G in the eighth. Each pair of aligned characters is assigned a score according to the following scoring matrix.


denotes that a space-space match is not allowed. The score of the alignment above is (-3)+5+5+(-2)+(-3)+5+(-3)+5=9.

Of course, many other alignments are possible. One is shown below (a different number of spaces are inserted into different positions):

AGTGATG
-GTTA-G

This alignment gives a score of (-3)+5+5+(-2)+5+(-1) +5=14. So, this one is better than the previous one. As a matter of fact, this one is optimal since no other alignment can have a higher score. So, it is said that the
similarity of the two genes is 14.

Input
The input consists of T test cases. The number of test cases ) (T is given in the first line of the input file. Each test case consists of two lines: each line contains an integer, the length of a gene, followed by a gene sequence. The length of each gene sequence is at least one and does not exceed 100.

Output
The output should print the similarity of each test case, one per line.

Sample Input

2 
7 AGTGATG 
5 GTTAG 
7 AGCTATT 
9 AGCTTTAAA 

Sample Output

14
21 

Source
Taejon 2001

???????#include? < iostream >
using ? namespace ?std;

int ?map[ 100 ][ 100 ];
int ?initMap()
{
????map[
' A ' ][ ' C ' ]? = ?map[ ' C ' ][ ' A ' ]? = ? - 1 ;
????map[
' A ' ][ ' G ' ]? = ?map[ ' G ' ][ ' A ' ]? = ? - 2 ;
????map[
' A ' ][ ' T ' ]? = ?map[ ' T ' ][ ' A ' ]? = ? - 1 ;
????map[
' A ' ][ ' - ' ]? = ?map[ ' - ' ][ ' A ' ]? = ? - 3 ;

????map[
' C ' ][ ' G ' ]? = ?map[ ' G ' ][ ' C ' ]? = ? - 3 ;
????map[
' C ' ][ ' T ' ]? = ?map[ ' T ' ][ ' C ' ]? = ? - 2 ;
????map[
' C ' ][ ' - ' ]? = ?map[ ' - ' ][ ' C ' ]? = ? - 4 ;

????map[
' G ' ][ ' T ' ]? = ?map[ ' T ' ][ ' G ' ]? = ? - 2 ;
????map[
' G ' ][ ' - ' ]? = ?map[ ' - ' ][ ' G ' ]? = ? - 2 ;

????map[
' T ' ][ ' - ' ]? = ?map[ ' - ' ][ ' T ' ]? = ? - 1 ;

????map[
' A ' ][ ' A ' ]? = ?map[ ' T ' ][ ' T ' ]? = ?map[ ' G ' ][ ' G ' ]? = ?map[ ' C ' ][ ' C ' ]? = ? 5 ;
????map[
' - ' ][ ' - ' ]? = ? - 128 ;
????
return ? 0 ;
}


int ?solve()
{
????
int ?i,?j;
????
char ?s1[ 105 ],?s2[ 105 ];
????
int ?dp[ 105 ][ 105 ];
????
int ?l1,?l2;
????cin?
>> ?l1? >> ?s1? >> ?l2? >> ?s2;
????dp[
0 ][ 0 ]? = ? 0 ;
????
for ?(i = 1 ;?i <= l1;?i ++ )
????????dp[i][
0 ]? = ?dp[i - 1 ][ 0 ]? + ?map[s1[i - 1 ]][ ' - ' ];
????
for ?(i = 1 ;?i <= l2;?i ++ )
????????dp[
0 ][i]? = ?dp[ 0 ][i - 1 ]? + ?map[ ' - ' ][s2[i - 1 ]];

????
for ?(i = 1 ;?i <= l1;?i ++ )
????????
for ?(j = 1 ;?j <= l2;?j ++ )
????????
{
????????????dp[i][j]?
= ?dp[i - 1 ][j - 1 ]? + ?map[s1[i - 1 ]][s2[j - 1 ]];
????????????
if ?(dp[i][j]? < ?dp[i][j - 1 ]? + ?map[ ' - ' ][s2[j - 1 ]])
????????????????dp[i][j]?
= ?dp[i][j - 1 ]? + ?map[ ' - ' ][s2[j - 1 ]];
????????????
if ?(dp[i][j]? < ?dp[i - 1 ][j]? + ?map[s1[i - 1 ]][ ' - ' ])
????????????????dp[i][j]?
= ?dp[i - 1 ][j]? + ?map[s1[i - 1 ]][ ' - ' ];
????????}

????cout?
<< ?dp[l1][l2]? << ?endl;
????
return ? 0 ;
}

int ?main()
{
????initMap();
????
int ?caseTime;

????cin?
>> ?caseTime;
????
while ?(caseTime -- ? != ? 0 )
????
{
????????solve();
????}

????
return ? 0 ;
}
posted on 2006-08-21 15:47 閱讀(623) 評論(0)  編輯 收藏 引用 所屬分類: ACM題目
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            美日韩在线观看| 午夜影院日韩| 国产精品视频第一区| 欧美午夜精品久久久久久孕妇 | 国产精品免费看片| 国产精品swag| 国产午夜精品一区理论片飘花| 国产视频综合在线| 91久久国产自产拍夜夜嗨| 亚洲电影在线免费观看| 中文网丁香综合网| 久久九九国产精品怡红院| 欧美激情在线免费观看| 亚洲精一区二区三区| 午夜伦欧美伦电影理论片| 久久午夜国产精品| 欧美午夜精彩| 亚洲激情午夜| 午夜精品在线| 亚洲国产高清在线观看视频| 亚洲全黄一级网站| 欧美一区二区三区的| 欧美日韩二区三区| 尤物九九久久国产精品的特点 | 国产精品高潮呻吟久久| 国产精品久久二区二区| 亚洲国产国产亚洲一二三| 欧美亚洲综合另类| 亚洲精选视频免费看| 久久久综合激的五月天| 国产精品不卡在线| 亚洲欧洲美洲综合色网| 欧美制服丝袜| 这里只有精品丝袜| 国产日韩欧美黄色| 牛人盗摄一区二区三区视频| 国产精品一区一区| 99国内精品久久久久久久软件| 久久久久久一区二区| 亚洲男人av电影| 欧美日精品一区视频| 亚洲精品美女| 亚洲福利视频网站| 欧美一区二区视频在线| 国产精品久久久久毛片大屁完整版 | 亚洲狼人精品一区二区三区| 久久网站免费| 激情久久久久久久久久久久久久久久| 亚洲欧美日本伦理| 一区二区电影免费在线观看| 欧美激情在线观看| 亚洲毛片一区| 亚洲日本中文字幕区| 欧美激情国产高清| 99精品视频免费全部在线| 亚洲国产日韩欧美在线99| 欧美大片在线影院| 99在线|亚洲一区二区| 亚洲精品视频在线观看免费| 欧美精品v日韩精品v韩国精品v| 91久久精品美女高潮| 亚洲国产第一页| 欧美激情a∨在线视频播放| 亚洲精品视频二区| 99国产精品| 国产伦精品一区二区| 久久久久国内| 久久综合网色—综合色88| 在线观看一区二区精品视频| 欧美电影免费| 欧美日韩国产综合久久| 午夜视频在线观看一区| 亚洲免费网址| 亚洲女人小视频在线观看| 亚洲字幕在线观看| 狠狠综合久久av一区二区小说 | 欧美成人一品| 一区二区三区四区五区视频| 亚洲色图自拍| 狠狠爱综合网| 日韩一级在线观看| 国产亚洲欧美一区| 欧美激情第3页| 国产精品久久综合| 老司机免费视频一区二区| 欧美国产免费| 欧美一级电影久久| 男男成人高潮片免费网站| 亚洲在线成人| 久久一区二区三区四区| 免费成人小视频| 国产精品日韩一区二区| 老色鬼久久亚洲一区二区| 欧美日韩一区二区三区在线视频| 久久久久久久综合| 欧美精品91| 久久久综合精品| 欧美日韩成人综合在线一区二区| 欧美在线啊v一区| 欧美另类videos死尸| 久久久天天操| 欧美日韩一区二| 欧美成人免费在线| 国产乱肥老妇国产一区二| 亚洲国产国产亚洲一二三| 国产日韩欧美自拍| 亚洲三级影院| 在线播放不卡| 午夜精品一区二区三区四区 | 亚洲精品视频在线播放| 伊人久久久大香线蕉综合直播| 这里只有精品丝袜| 99在线精品观看| 玖玖国产精品视频| 久久―日本道色综合久久| 国产精品免费电影| 亚洲乱码国产乱码精品精天堂| 在线免费精品视频| 久久精品欧美日韩| 欧美一级电影久久| 国产精品美女久久久久久免费| 欧美日本在线视频| 美女性感视频久久久| 国产亚洲欧美一区二区三区| 亚洲伊人久久综合| 亚洲免费在线视频| 欧美系列电影免费观看| 亚洲日本va午夜在线电影| 亚洲国产欧美一区二区三区久久 | 亚洲美女一区| 欧美大片18| 亚洲九九精品| 亚洲一品av免费观看| 欧美视频在线看| 亚洲一区影音先锋| 久久成人av少妇免费| 国产日韩欧美三区| 羞羞视频在线观看欧美| 久久大逼视频| 激情视频一区| 狼人天天伊人久久| 欧美黑人多人双交| 亚洲国产激情| 欧美日本中文| 亚洲视频在线二区| 久久精选视频| 亚洲精品乱码| 欧美日韩性生活视频| 亚洲女同精品视频| 久久综合亚州| 最新日韩在线| 99国产精品99久久久久久| 欧美日韩第一区| 日韩亚洲欧美一区二区三区| 亚洲一区久久久| 国产精品久久久久久久午夜片| 亚洲一区二区视频| 蜜臀av国产精品久久久久| 在线色欧美三级视频| 欧美日韩精品免费观看| 在线综合+亚洲+欧美中文字幕| 99精品热6080yy久久| 国产亚洲女人久久久久毛片| 久热这里只精品99re8久| 一本色道久久88精品综合| 久久精品亚洲一区二区三区浴池| 亚洲国产免费| 欧美性淫爽ww久久久久无| 欧美激情麻豆| 亚洲欧美日韩在线观看a三区| 一区二区三区在线免费视频| 欧美日韩一区二区精品| 久久亚洲春色中文字幕久久久| 日韩亚洲欧美精品| 久久精品一二三| 99综合精品| 激情一区二区| 国产精品视频xxxx| 欧美人体xx| 久久久久久香蕉网| 国产精品99久久久久久久vr | 欧美一区国产在线| 亚洲国产一区二区三区青草影视 | 影音先锋亚洲电影| 国产精品狠色婷| 久久伊人免费视频| 亚洲午夜黄色| 亚洲国产日韩一区| 久久综合久久综合这里只有精品| 亚洲无限乱码一二三四麻| 亚洲欧洲日夜超级视频| 国产亚洲欧美aaaa| 国产精品狠色婷| 欧美日本三区| 免播放器亚洲一区| 久久精品国产69国产精品亚洲| 亚洲免费视频中文字幕| 亚洲一区国产| 亚洲一区二区三区国产| 亚洲特色特黄|