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

隨筆 - 87  文章 - 279  trackbacks - 0
<2025年12月>
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

潛心看書研究!

常用鏈接

留言簿(19)

隨筆分類(81)

文章分類(89)

相冊

ACM OJ

My friends

搜索

  •  

積分與排名

  • 積分 - 221413
  • 排名 - 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 閱讀(631) 評論(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>
            亚洲欧洲三级电影| 亚洲一线二线三线久久久| 久久大逼视频| 另类春色校园亚洲| 1769国内精品视频在线播放| 久热精品在线视频| 亚洲国产欧美在线人成| 亚洲卡通欧美制服中文| 欧美日韩另类视频| 亚洲欧美日韩综合| 欧美成人免费va影院高清| 亚洲国内精品在线| 欧美日韩在线一区二区| 久久gogo国模啪啪人体图| 久久亚洲春色中文字幕久久久| 久热爱精品视频线路一| 亚洲黄色影片| 国产精品久久久久久五月尺| 久久av在线| 亚洲黄色视屏| 久久精品91| 亚洲精品美女久久7777777| 国产精品盗摄一区二区三区| 久久av资源网| 9色精品在线| 狂野欧美一区| 亚洲欧美日韩一区| 亚洲第一综合天堂另类专| 悠悠资源网亚洲青| 午夜伦理片一区| 精品999成人| 欧美日韩国产区一| 久久久国产视频91| 一本久久综合亚洲鲁鲁五月天| 久久精品一区二区国产| 99亚洲伊人久久精品影院红桃| 国产欧美日本| 欧美日韩国产综合久久| 久久精品视频在线| 亚洲一区二区三区在线观看视频| 欧美.www| 久久久久久久尹人综合网亚洲 | 亚洲欧美经典视频| 国产欧美日本| 欧美日韩亚洲激情| 美女黄色成人网| 亚洲欧美在线免费观看| 亚洲人成在线观看| 女同一区二区| 久久久九九九九| 午夜精品短视频| 在线亚洲精品| 亚洲人精品午夜| 一区二区在线观看av| 国产精品美女诱惑| 欧美视频在线观看 亚洲欧| 美女主播一区| 久久先锋影音| 久久国产视频网| 性做久久久久久| 亚洲综合精品| 亚洲午夜一区二区三区| 亚洲精品护士| 亚洲欧洲日夜超级视频| 欧美高清hd18日本| 欧美电影免费观看| 欧美日产一区二区三区在线观看| 午夜精品久久久久久久男人的天堂| 亚洲国产精品久久久久婷婷884| 久久久久九九视频| 久久久精品五月天| 久久这里有精品15一区二区三区| 欧美一乱一性一交一视频| 亚洲男女毛片无遮挡| 亚洲一区二区视频在线| 亚洲手机视频| 亚洲欧美在线视频观看| 香蕉亚洲视频| 欧美在线视频免费观看| 久久精品亚洲精品| 理论片一区二区在线| 免费高清在线视频一区·| 免费不卡在线视频| 欧美黄网免费在线观看| 亚洲激情电影在线| 一二三区精品福利视频| 亚洲男人天堂2024| 久久高清免费观看| 久久影院午夜论| 欧美精品在线播放| 国产精品极品美女粉嫩高清在线| 日韩一级黄色av| 国产精品久久久久久久久| 欧美日韩一区二区三区在线| 欧美日韩国产一区二区| 欧美视频不卡中文| 国产精品一区视频网站| 伊人久久噜噜噜躁狠狠躁| 亚洲国产欧美在线人成| 一区二区国产精品| 久久本道综合色狠狠五月| 免费观看成人www动漫视频| 亚洲欧洲一区二区三区| 亚洲调教视频在线观看| 欧美一区二区视频97| 蜜桃av一区二区| 国产精品福利网站| 极品尤物久久久av免费看| 日韩网站在线观看| 久久国产主播| 亚洲人成小说网站色在线| 亚洲欧美日韩国产成人精品影院| 久久精品水蜜桃av综合天堂| 欧美极品一区二区三区| 国产老肥熟一区二区三区| 亚洲国产精品免费| 亚洲一区二区三区视频| 麻豆91精品| 久久视频在线视频| 中国成人黄色视屏| 欧美在线在线| 欧美理论在线播放| 国产一区二区三区在线观看免费 | 国产精自产拍久久久久久| 一区二区三区亚洲| 亚洲图片欧美日产| 女人天堂亚洲aⅴ在线观看| 亚洲影视中文字幕| 欧美成人国产一区二区| 国产亚洲成av人片在线观看桃 | 久久人人爽人人爽| 国产精品免费看片| 亚洲精品无人区| 久久综合色综合88| 亚洲已满18点击进入久久| 欧美黄色精品| 亚洲高清激情| 久久久91精品国产| 亚洲一区在线观看免费观看电影高清| 巨胸喷奶水www久久久免费动漫| 国产欧美不卡| 国产日韩欧美三区| 国产精品美女主播在线观看纯欲| 影音先锋日韩有码| 欧美亚洲综合在线| 99国产精品久久久久久久| 美女被久久久| 亚洲国产天堂久久综合| 久久久久天天天天| 欧美在线关看| 国产日韩欧美亚洲| 欧美伊人久久| 制服丝袜亚洲播放| 欧美丝袜一区二区三区| 日韩一级在线观看| 亚洲国产欧美在线人成| 欧美.日韩.国产.一区.二区| 欲色影视综合吧| 猛男gaygay欧美视频| 欧美专区在线观看| 国内精品久久久久影院色 | 依依成人综合视频| 久久午夜国产精品| 久久精品夜色噜噜亚洲aⅴ| 国产三区精品| 久久久久网站| 久久亚洲二区| 一本大道久久a久久精品综合| 欧美黄色免费| 亚洲区一区二区三区| 欧美ed2k| 蜜臀久久久99精品久久久久久| 在线观看日韩国产| 欧美波霸影院| 欧美国产日韩视频| 亚洲一区二区在线看| 亚洲丝袜av一区| 国产拍揄自揄精品视频麻豆| 欧美在线一二三| 久久久久国产成人精品亚洲午夜| 极品尤物av久久免费看| 亚洲国产日韩美| 欧美色图五月天| 欧美一区二区网站| 欧美尤物一区| 亚洲国产精品电影在线观看| 亚洲国产电影| 国产精品高清一区二区三区| 久久精品国产精品| 老司机免费视频久久| 夜夜嗨av一区二区三区免费区| 艳女tv在线观看国产一区| 国产日产高清欧美一区二区三区| 久久久五月婷婷| 欧美精品一区在线观看| 久久福利精品| 欧美成人tv| 久久国产精品电影| 欧美成人精品1314www| 亚洲欧美不卡|