题目来源:基因工程 解题思路:假设基因序列长度为N,则需要计算基因序列前K个和后K个相同所需要的最少改变次数sum. 假设基因序列为 ATACGTCT (即M=8),K=6:interval=M-K=2: 0 1 2 3 4 5 6 7 sq1 A T A C G T C T sq2 A C G T C T 从上图可以看出,标有相同彩色的字符相同,sq1的下标为0的字符与sq2的下标为0的字符相同,即 sq1[0]==sq1[2],由此可以得出sq1…
Fractal Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://hihocoder.com/contest/acmicpc2015beijingonline/problem/8 Description This is the logo of PKUACM 2016. More specifically, the logo is generated as follows: 1. Put four points A0(0,0), B0(0,1),…
2045. Richness of words 题目连接: http://acm.timus.ru/problem.aspx?space=1&num=2045 Description For each integer i from 1 to n, you must print a string si of length n consisting of lowercase Latin letters. The string si must contain exactly i distinct pa…
Description Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. Petya has two str…