题解 | #DNA序列#
DNA序列
http://www.nowcoder.com/practice/e8480ed7501640709354db1cc4ffd42a
def ratio(s): return (s.count("G")+s.count("C"))/len(s) while True: try: n=0 s=input().strip() l=int(input()) str_list=[] for i in range(len(s)-l+1): if ratio(s[i:i+l])>n: str_list.append(s[i:i+l]) n=ratio(s[i:i+l]) print(str_list[-1]) except: break