Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:一个O(N)复杂度的解法,欢迎评论In Reply To:一个O(N)复杂度的解法,欢迎评论 Posted by:njuallen at 2015-02-08 23:39:52 感觉measure还是些麻烦了吧,我这么写的: ... int measure=0 int A,C,G,T; A=C=G=T=0; for(char* p=str;*p;p++){ switch(*p){ case 'A': measure+=C+G+T; ++A; break; case 'C': measure+=G+T; ++C; break; case 'G': measure+=T; ++G; break; case 'T': ++T; break; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator